zabbix orabbix 监控oracle
简介:Orabbix is an Oracle monitoring daemon. Actually is the smart and easy way to keep monitored Oracle and it’s completely integrated with Zabbix. Orabbix is wrote in java and is based on apache daemons so can run on Unix, Linux and Windows
 
 
 
安装java
[root@wuhan-test-dg ~]# yum install java
 
建立安装目录,解压插件包并上传至/opt/orabbix目录
[root@wuhan-test-dg ~]# mkdir /opt/orabbix
 
上传完成后,给orabbix目录中的所有文件设定权限
[root@wuhan-test-dg ~]# chmod -R a+x /opt/orabbix
 
通过/opt/orabbix/conf/config.props.sample文件创建一个config.props文件
[root@wuhan-test-dg ~]# cp /opt/orabbix/conf/config.props.sample /opt/orabbix/conf/config.props
 
编辑刚创建的配置文件
[root@wuhan-test-dg ~]# vim /opt/orabbix/conf/config.props
#comma separed list of Zabbix servers
ZabbixServerList=ZabbixServer1
ZabbixServer1.Address=127.0.0.1
ZabbixServer1.Port=10051
 
#pidFile
OrabbixDaemon.PidFile=./logs/orabbix.pid
#frequency of item’s refresh
OrabbixDaemon.Sleep=300
#MaxThreadNumber should be >= than the number of your databases
OrabbixDaemon.MaxThreadNumber=100
 
#put here your databases in a comma separated list
DatabaseList=wuhan-test-dg
 
#Configuration of Connection pool
#if not specified Orabbis is going to use default values (hardcoded)
#Maximum number of active connection inside pool
DatabaseList.MaxActive=10
#The maximum number of milliseconds that the pool will wait 
#(when there are no available connections) for a connection to be returned 
#before throwing an exception, or <= 0 to wait indefinitely. 
DatabaseList.MaxWait=100
DatabaseList.MaxIdle=1
 
#define here your connection string for each database
wuhan-test-dg.Url=jdbc:oracle:thin:@10.161.138.10:1521:dcwhtest
wuhan-test-dg.User=zabbix
wuhan-test-dg.Password=zabbix
#Those values are optionals if not specified Orabbix is going to use the general values
wuhan-test-dg.MaxActive=10
wuhan-test-dg.MaxWait=100
wuhan-test-dg.MaxIdle=1
wuhan-test-dg.QueryListFile=./conf/query.props
 
 
 
创建账户和权限
CREATE USER ZABBIX
     IDENTIFIED BY zabbix   
     DEFAULT TABLESPACE SYSTEM
     TEMPORARY TABLESPACE TEMP
     PROFILE DEFAULT
     ACCOUNT UNLOCK;
   GRANT CONNECT TO ZABBIX;
     GRANT RESOURCE TO ZABBIX;
     ALTER USER ZABBIX DEFAULT ROLE ALL;
   GRANT SELECT ANY TABLE TO ZABBIX;
       GRANT CREATE SESSION TO ZABBIX;
     GRANT SELECT ANY DICTIONARY TO ZABBIX;
     GRANT UNLIMITED TABLESPACE TO ZABBIX;
     GRANT SELECT ANY DICTIONARY TO ZABBIX;
 
exec dbms_network_acl_admin.create_acl(acl => ‘resolve.xml’,description =>’resolve acl’, principal =>’ZABBIX’, is_grant => true, privilege =>’resolve’);
exec dbms_network_acl_admin.assign_acl(acl=> ‘resolve.xml’, host =>’*’);
commit;
 
将orabbix中的执行文件Copy到系统服务目录中
[root@wuhan-test-dg ~]# cp /opt/orabbix/init.d/orabbix /etc/init.d/orabbix
 
使用/etc/init.d/orabbix start来启动Orabbix服务
注意:如果以上的config.props文件没有配置,或是配置了,但无法通过配置的信息正确连进Oracle数据库的话,执行以上命令,可是run.sh会出现如下的错误提示:
[root@wuhan-test-dg admin]# /etc/init.d/orabbix start
Starting Orabbix service:
[root@wuhan-test-dg admin]# Stopping
java.lang.Exception: ERROR on main – Connections is empty
at com.smartmarmot.orabbix.Orabbixmon.run(Orabbixmon.java:101)
at com.smartmarmot.orabbix.bootstrap.main(bootstrap.java:50)
 
将Orabbix服务加入随系统启动
[root@wuhan-test-dg orabbix]# chkconfig –add orabbix
[root@wuhan-test-dg orabbix]# chkconfig –level 345 orabbix on
 
在zabbix的WEB页面去导入ORACLE的监测模板,在orabbix目录的template内,只要在configuration->Templates->Import Template,然后选中orabbix/template/Orabbix_export_full.xml
 
 在configuration->Templates->Hosts中添加Oracle主机吧!记得Name要等于你在config.props中设的名字哦,另外,要将此机器加入到Template Oracle中
 
配置完成,就可以看到监控图啦
 
 1
 
 
 
 
 
2

共有 0 条评论

Top