开源监控解决方案:zabbix 监控oracle database(二)
2018-09-19 09:29
676 查看
[root@amb01 ~]# vi /opt/zdba/conf/config.pl { zabbix => { host => '192.168.40.35', --zabbix server port => 10051, timeout => 30, }, daemon => { sleep => 60, split_logs => 1 }, db => { default => { user => 'zabbix', pass   111c ; => 'zabbix', query_list => 'query.props.pl', sleep => 60, retry_step => 1, }, list => [qw|amb01|], amb01 => { dsn => 'DBI:Oracle:host=192.168.40.40;port=1521;sid=hxdb1', query_list => [qw|query.props.pl|], sleep => 60, }, }, } [root@amb01 ~]# vi /opt/zdba/conf/query.props.pl list => [ 'dbversion', 'dbuptime', 'dbsizetotal', 'dbsizeused', 'dblogswitch', 'dbredosize', ......略 ], dbversion => { query => q{ select banner from v$version where banner like '%Oracle Database%' }, }, dbuptime => { query => q{ select (sysdate - startup_time) * 86400 from v$instance }, }, dbsizetotal => { query => q{ select sum(bytes) from dba_data_files }, }, dbsizeused => { query => q{ select sum((a.bytes-f.bytes)) from dba_tablespaces d, (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name, sum(bytes) bytes from dba_free_space group by tablespace_name) f where d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+) and not (d.extent_management like 'LOCAL' AND d.contents like 'TEMPORARY') }, }, dblogswitch => { query => q{ select count(*) from v$log_history where to_char(first_time) >= to_char(sysdate) }, }, dbredosize => { query => q{ select value from v$sysstat where name='redo size' }, }, ......略 discovery => { rule => { tablespaces => { &nb 5ac sp; query => q{ select name ts from v$tablespace }, keys => ['TS'], }, }, item => { ts_usage_pct => { query => q{ select d.tablespace_name ts, to_char (nvl ((a.bytes - nvl (f.bytes, 0)) / a.bytes * 100, 0), '990.00' ) pct from sys.dba_tablespaces d, (select tablespace_name, sum (bytes) bytes from dba_data_files group by tablespace_name) a, (select & 27e4 nbsp; tablespace_name, sum (bytes) bytes from dba_free_space group by tablespace_name) f where d.tablespace_name = a.tablespace_name(+) and d.tablespace_name = f.tablespace_name(+) and not (d.extent_management like 'LOCAL' and d.contents like 'TEMPORARY') union all select d.tablespace_name ts, to_char (nvl (t.bytes / a.bytes * 100, 0), '990.00') pct from sys.dba_tablespaces d, (select tablespace_name, sum (bytes) bytes from dba_temp_files group by tablespace_name) a, (select tablespace_name, sum (bytes_cached) bytes from v$temp_extent_pool group by tablespace_name) t where d.tablespace_name = a.tablespace_name(+) and d.tablespace_name = t.tablespace_name(+) and d.extent_management like 'LOCAL' and d.contents like 'TEMPORARY' }, keys => { TS => 'PCT' } }, ts_usage_bytes => { query => q{ select d.tablespace_name ts , nvl(a.bytes - nvl(f.bytes, 0), 0) bytes from sys.dba_tablespaces d , ( select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name ) a , ( select tablespace_name, sum(bytes) bytes from dba_free_space group by tablespace_name ) f where d.tablespace_name = a.tablespace_name(+) and d.tablespace_name = f.tablespace_name(+) and not ( d.extent_management like 'LOCAL' and d.contents like 'TEMPORARY' ) union all select d.tablespace_name ts , nvl(t.bytes, 0) bytes from sys.dba_tablespaces d , ( select tablespace_name, sum(bytes) bytes from dba_temp_files group by tablespace_name ) a , ( select tablespace_name, sum(bytes_cached) bytes from v$temp_extent_pool group by tablespace_name ) t where d.tablespace_name = a.tablespace_name(+) and d.tablespace_name = t.tablespace_name(+) and d.extent_management like 'LOCAL' and d.contents like 'TEMPORARY' }, keys => { TS => 'BYTES' } }, }, }, }zabbix server item
相关文章推荐
- 开源监控解决方案:zabbix 监控oracle database(一)
- 开源监控解决方案:zabbix 监控mysql database(fpmmm)
- 开源监控解决方案:zabbix email notification
- 开源监控解决方案:zabbix 监控mysql database(Golang)
- 开源监控解决方案nagios+pnp4nagios+nconf+ndoutils整合部署 推荐
- 分布式监控解决方案zabbix02-使用agent监控其他linux
- zabbix 开源监控 二、 windows 主机添加 agent 服务
- 分布式监控解决方案zabbix03-监控mysql
- 开源商业级服务器监控软件Zabbix 3.4.4部署方法
- 安装配置Zabbix开源监控
- Zabbix监控Haproxy解决方案
- zabbix监控非rpm方式安装的mysql报错的原因及解决方案
- Zabbix 开源监控系列 一、zabbix 源码安装
- 分布式开源zabbix 监控模板汇总
- 好用开源的Zabbix-mysql监控插件
- 分布式监控解决方案zabbix01-介绍及安装
- 企业级开源监控软件zabbix部署文档
- zabbix 企业级网络监控解决方案
- Zabbix监控解决方案
- zabbix开源监控系列二(mysql+redis 模板)