首先我们需要在被监控的Oracle上面创建一个账号,用于zabbix的数据获取,在oracle的sqlplus里面执行。
CREATE USER ZABBIX
IDENTIFIED BY "zabbix"
DEFAULT TABLESPACE SYSTEM
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT
ACCOUNT UNLOCK;
#2 Roles for ZABBIX
GRANT CONNECT TO ZABBIX;
GRANT RESOURCE TO ZABBIX;
ALTER USER ZABBIX DEFAULT ROLE ALL;
#5 System Privileges for ZABBIX
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; 如果我们的数据库是Oracle 11g,我们还需要执行下面的语句。
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; 4、配置config.props
config.props是Orabbix的配置文件,路径为/usr/local/orabbix/conf。
cp config.props.sample config.props 打开配置文件,修改后内容如下:
#comma separed list of Zabbix servers
ZabbixServerList=ZabbixServer1
ZabbixServer1.Address=10.0.0.14
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=10.0.2.64,10.0.2.63
#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 Templates-->Import