Orabbix is a Zabbix plug-in used to monitor an Oracle db instance. (Plug-in installed on Zabbix-server side)
: http://www.smartmarmot.com/product/orabbix/download/
operation on Zabbix-server
Orabbix is using JDBC to connect to the Oracle database and then filter the desired data, so the JDK environment
I have tested jdk1.7 and 1.8 can, direct yum installation, or download RPM package, RPM-IVH installation, can
Here, I am the direct RPM installation,
[Email protected] ~]# RPM-IVH jdk-8u102-linux-x64.rpmpreparing ... ########################################### [100%] 1:jdk1.8.0_102 ##################################### ###### [100%]
Create a new Orabbix directory under the/OPT directory:
[[email protected] Orabbix] #midir-P/opt/orabbix
(Recommended in this directory, if you put other directories later need to change the Orabbix startup file Orabbix, the boot file is written by default in the Opt/orabbix directory)
[Email protected] opt]# CD orabbix/
Upload Orabbix-1.2.3.zip
[[email protected] orabbix]# lsorabbix-1.2.3.zip unzip [[email protected] orabbix]# unzip-q Orabbix-1.2.3.zip[[email Protected] orabbix]# lsconf init.d lib orabbix-1.2.3.zip orabbixw.exe run.sh Uninstall.cmddoc install.cmd orabbix-1.2.3.jar orabbix.exe run.bat template authorization [[Email Protected] orabbix]# CD. [[email protected] opt]# chmod-r a+x orabbix/[[email protected] ~]# cd/opt/orabbix/conf/[[email protected] conf]# lsconf Ig.props log4j.properties query_a_1.props query_b.props query.propsconfig.props.sample log4j.properties.sample query_a.props query-copy.props query.props.sample[[email protected ] conf]# CP config.props.sample Config.props
To edit a configuration file:
[Email protected] conf]# vim Config.props
Source Configuration file
[[email protected] conf]# egrep "^[a-z,1-9]" config.props.samplezabbixserverlist=zabbixserver1, Zabbixserver2zabbixserver1.address=ip_address_of_zabbix_serverzabbixserver1.port=port_of_zabbix_ Serverzabbixserver2.address=ip_address_of_zabbix_serverzabbixserver2.port=port_of_zabbix_ Serverorabbixdaemon.pidfile=./logs/orabbix.pidorabbixdaemon.sleep=300orabbixdaemon.maxthreadnumber= 100DATABASELIST=DB1,DB2,DB3DATABASELIST.MAXACTIVE=10DATABASELIST.MAXWAIT=100DATABASELIST.MAXIDLE=1DB1. Url=jdbc:oracle:thin: @server .domain.example.com:<listener_port>:D b1db1. USER=ZABBIXDB1.PASSWORD=ZABBIX_PASSWORDDB1.MAXACTIVE=10DB1. MAXWAIT=100DB1. MAXIDLE=1DB1. Querylistfile=./conf/query.propsdb2.url=jdbc:oracle:thin: @server2 .domain.example.com:<listener_port>:D B2db2. user=zabbixdb2.password=zabbix_passworddb2.querylistfile=./conf/query.propsdb3.url=jdbc:oracle:thin:@ Server3.domain.example.com:<listener_port>:D b3db3. User=zabbixdb3.password=zabbix_passworddb3.querylistfile=./conf/query.props
after modification
[[email protected] conf]# egrep "^[a-z,1-9]" Config.propszabbixserverlist=zabbixserver1 # (Zabbixserver's name, address and port in the downlink are referenced to this name, so the following two lines of prefix name to be consistent with the name here) zabbixserver1.address=127.0.0.1 #我这里就是在zabbix Server, so this is 127.0.0.1zabbixserver1.port=10051 #zabbix Server's service port orabbixdaemon.pidfile=./logs/orabbix.pidorabbixdaemon.sleep=300orabbixdaemon.maxthreadnumber= 100databaselist=172.20.10.183-oracle,192.168.56.99-oracle #这里很重要, with the corresponding databaselist.maxactive= 10databaselist.maxwait=100databaselist.maxidle=1172.20.10.183-oracle. URL=JDBC:ORACLE:THIN:@172.20.10.183:1521:ORCL #172.20.10.183 the address of the Oracle database, Port 1521, ORCL DB instance name 172.20.10.183-oracle.user=zabbix #授权的账号172.20.10.183-oracle.password=zabbix # The authorized password 172.20.10.183-oracle.maxactive=10172.20.10.183-oracle. Maxwait=100172.20.10.183-oracle. Maxidle=1172.20.10.183-oracle. Querylistfile=./conf/query.props #要查询的语句都在这定义的, not satisfied with their own change
operation on Oracle host (This step can be omitted, as long as the database instance, account number, password)
The following is the Oracle 11g (12c syntax is not the same) authorization statements are as follows, the user, authorization, these operations, I am in the Oracle database Sqlplus execution of the
[[email protected] ~]$ sqlplus/as sysdba sql*plus:release 11.2.0.3.0 Production on Wed Sep 7 18:01:54 2016Copyright (c) 1982, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit productionwith The partitioning, OLAP, Data Mining and Real Application testing optionssql>create USER ZABBIX identified by ZABBIX DEFAULT tablespace SYSTEM TEMPO Rary 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; GRANT SELECT on v_$session to ZABBIX; GRANT SELECT on v_$system_event to ZABBIX; GRANT SELECT on V_$event_name to ZABBIX; GRANT SELECT on v_$recovery_file_dest to ZABBIX;
Start Orabbix
[email protected] orabbix]# CP init.d/orabbix/etc/init.d/
[Email protected] orabbix]# Ll/etc/init.d/orabbix
-rwxr-xr-x 1 root root 1693 Sep 21:40/etc/init.d/orabbix
[[email protected] orabbix]#/etc/init.d/orabbix start
Starting Orabbix Service:
Error, check the configuration file, database address, port, instance name, account number, password is correct, need to verify how to do not understand Oracle, search command Bai, I also come all the way, various pits ~~~~~
And look inside the log.
[Email protected] orabbix]# Tailf/opt/orabbix/logs/orabbix.log
[Main] INFO orabbix----------on Database-ORCL
[Pool-1-thread-1] WARN orabbix-error while executing->dbversion-on database->172.20.10.183-oracle-exception received ORA-24247: Network access denied by Access control List (ACL)
Ora-06512:at "SYS. Utl_inaddr ", line 4
Ora-06512:at "SYS. Utl_inaddr ", line 35
Ora-06512:at Line 1
The presence of these logs does not affect the subsequent operations, if you are perfectionist, meet your
Execute the following three commands under the Sqlplus of the Oracle database
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
Here, the installation configuration is complete, then the template can be imported directly through the Web page Access monitoring interface.
The template is placed under/opt/orabbix/template
Orabbix_export_full.xml #只需要导入这个一个模板就好
Add Host
Then link the Oracle template
Effects after adding a finish
View the latest data
And then there's the picture.
Common errors
[Email protected] orabbix]# Tailf/opt/orabbix/logs/orabbix.log
[Main] ERROR orabbix-error on Configurator for database 172.20.10.183 Oracle-->ora-01017:invalid Username/password; Logon denied
Config.props configuration file, the database account password is incorrect, or the user is not authorized in the Oracle database
Zabbix using Orabbix to monitor Oracle