由于公司要上oracle数据库,需要对这个东西惊醒监控,于是去网上淘资料,发现有一个套件orabbix监控oracle的效果还不错,于是拿来试验了一下。orabbix是由JAVA写的一个套件,需要在oracle服务器上面安装JAVA环境才能运行。这里为了简便,可以使用yum -y install java来安装JAVA环境。
安装完java环境之后可以通过下面命令来检测是否安装成功:
[root@test ~]# java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.3.0.1.el6-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode) 如我上面这样显示就证明java环境已经安装成功了。
之后,我们就需要在oracle服务器上面安装orabbix套件了,可以去官网下载,目前最新版本是1.2.3,下载地址为:http://www.smartmarmot.com/downloads/orabbix-1.2.3.zip
下载完之后将其解压到/opt目录下,接下来,需要配置orabbix的配置文件了。先将配置文件的模板复制一份出来,然后开始配置:
cp orabbix/conf/config.props.sample orabbix/conf/config.props
vi !$
#comma separed list of Zabbix servers
ZabbixServerList=ZabbixServer1
ZabbixServer1.Address=10.6.0.180 #zabbix服务器的IP地址
ZabbixServer1.Port=10051 #zabbix服务器的监听端口
#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=DB_QM #这个名字可以自行命名,但是需要和下面的名字保持一致,并且在zabbixserver上面配置的主机名要和这个保持一致
#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 '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启动文件到etc目录下: