zabbix监控oracle

1、安装jdk(在zabbix服务端)(下载路径http://www.oracle.com/technetwork/java/javase/downloads/)
[root@zabbix ~]# rpm -ivh jdk-8u77-linux-x64.rpm 
Preparing...                ########################################### [100%]
   1:jdk1.8.0_77            ########################################### [100%]
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
jfxrt.jar...


2、安装orabbix(在zabbix服务端)(下载路径http://www.smartmarmot.com/product/orabbix/download/)
[root@zabbix ~]# mkdir /opt/orabbix
[root@zabbix ~]# mv orabbix-1.2.3.zip /opt/orabbix


[root@zabbix orabbix]# unzip orabbix-1.2.3.zip 
Archive:  orabbix-1.2.3.zip
   creating: conf/
  inflating: conf/config.props.sample  
  inflating: conf/log4j.properties   
  inflating: conf/log4j.properties.sample  
  inflating: conf/query.props        
  inflating: conf/query.props.sample  
  inflating: conf/query_a.props      
  inflating: conf/query_a_1.props    
  inflating: conf/query_b.props      
   creating: doc/
  inflating: doc/CHANGELOG.txt       
  inflating: doc/Orabbix_Install_v0.6.pdf  
  inflating: doc/gpl.txt             
   creating: init.d/
  inflating: init.d/orabbix          
  inflating: install.cmd             
   creating: lib/
  inflating: lib/commons-codec-1.4.jar  
  inflating: lib/commons-dbcp-1.4.jar  
  inflating: lib/commons-lang-2.5.jar  
  inflating: lib/commons-logging-1.1.1.jar  
  inflating: lib/commons-pool-1.5.4.jar  
  inflating: lib/hsqldb.jar          
  inflating: lib/log4j-1.2.15.jar    
  inflating: lib/ojdbc6.jar          
  inflating: orabbix-1.2.3.jar       
  inflating: orabbix.exe             
  inflating: orabbixw.exe            
  inflating: run.bat                 
  inflating: run.sh                  
   creating: template/
  inflating: template/Orabbix_export_full.xml  
  inflating: template/Orabbix_export_graphs.xml  
  inflating: template/Orabbix_export_items.xml  
  inflating: template/Orabbix_export_triggers.xml  
  inflating: uninstall.cmd           
  inflating: conf/query - Copy.props  


[root@zabbix orabbix]# chmod a+x /opt/orabbix -R
[root@zabbix orabbix]# cp /opt/orabbix/conf/config.props.sample /opt/orabbix/conf/config.props


修改配置文件如下:
[root@zabbix ~]# cat /opt/orabbix/conf/config.props | grep -v "#"
ZabbixServerList=ZabbixServer


ZabbixServer.Address=192.168.200.200
ZabbixServer.Port=10051






OrabbixDaemon.PidFile=./logs/orabbix.pid
OrabbixDaemon.Sleep=300
OrabbixDaemon.MaxThreadNumber=100


DatabaseList=ora10g


DatabaseList.MaxActive=10
DatabaseList.MaxWait=100
DatabaseList.MaxIdle=1


ora10g.Url=jdbc:oracle:thin:@192.168.200.66:1521/mydb
ora10g.User=zabbix
ora10g.Password=zabbix
ora10g.MaxActive=10
ora10g.MaxWait=100
ora10g.MaxIdle=1
ora10g.QueryListFile=./conf/query.props


[root@zabbix ~]# cp -a /opt/orabbix/init.d/orabbix /etc/init.d/orabbix   --创建orabbix服务(此时还无法启动该服务,因为oracle客户端的用户和密码还没有创建)




3、客户端创建用于zabbix连接的用户
create tablespace zabbix datafile '/app/oracle/oradata/mydb/zabbix.dbf' size 100M autoextend on next 10M;
create user zabbix identified by "zabbix" default tablespace zabbix temporary tablespace temp profile default account unlock;
grant alter session to zabbix;
grant create session to zabbix;
grant connect to zabbix;
alter user zabbix default role all;
grant select on v_$instance to zabbix;
grant select on dba_users to zabbix;
grant select on v_$log_history to zabbix;
grant select on v_$parameter to zabbix;
grant select on sys.dba_audit_session to zabbix;
grant select on v_$lock to zabbix;
grant select on dba_registry to zabbix;
grant select on v_$librarycache to zabbix;
grant select on v_$sysstat to zabbix;
grant select on v_$parameter to zabbix;
grant select on v_$latch to zabbix;
grant select on v_$pagstat to zabbix;
grant select on v_$sagstat to zabbix;
grant select on v_$librarycache to zabbix;
grant select on v_$process to zabbix;
grant select on dba_data_files to zabbix;
grant select on dba_temp_files to zabbix;
grant select on dba_free_space to zabbix;
grant select on v_$sysem_event to zabbix;


4、zabbix服务端启动orabbix服务
[root@zabbix ~]# /etc/init.d/orabbix start
Starting Orabbix service:
[root@zabbix ~]# /etc/init.d/orabbix status
Orabbix is running


5、登录zabbix服务器界面导入oracle监控模板
模板位置:/opt/orabbix/template
Orabbix_export_full.xml 全部导入(图表 监控项 触发器)
Orabbix_export_graphs.xml 图表
Orabbix_export_items.xml 监控项
Orabbix_export_triggers.xml 触发器


图形界面:Configuration --> Templates --> Import --> 浏览导入上面的四个文件


6、添加zabbix监控主机
Configuration --> Hosts --> Create host 


Host页面填写下面两项:Host name : ora10(和上面的配置文件config.props一致)
     IP address 192.168.200.66(被监控的oracle主机)
其他选项根据需要填写
Templates页面下添加oracle监控模板:Template_Oracle






OK!

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30373263/viewspace-2084293/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30373263/viewspace-2084293/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值