Zabbix using Orabbix to monitor Oracle

Source: Internet
Author: User
Tags db2 sqlplus egrep log4j



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/

[root@oracle orabbix]#midir -p /opt/orabbix



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,


[root@zabbix ~]# rpm -ivh jdk-8u102-linux-x64.rpm
 
Preparing...                ########################################### [100%]
 
   1:jdk1.8.0_102           ########################################### [100%]



Create a new Orabbix directory under the/OPT directory:




(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


[root@zabbix orabbix]# ls
 
Orabbix-1.2.3.zip
 
Decompression
 
[root@zabbix orabbix]# unzip -q orabbix-1.2.3.zip
 
[root@zabbix orabbix]# ls
 
Conf init.d lib orabbix-1.2.3.zip orabbixw.exe run.sh uninstall.cmd
 
Doc install.cmd orabbix-1.2.3.jar orabbix.exe run.bat template
 
Authorization
 
[root@zabbix orabbix]# cd ..
 
[root@zabbix opt]# chmod -R a+x orabbix/
 
[root@zabbix ~]# cd /opt/orabbix/conf/
 
[root@zabbix conf]# ls
 
Config.props log4j.properties query_a_1.props query_b.props query.props
 
Config.props.sample log4j.properties.sample query_a.props query - Copy.props query.props.sample
 
[root@zabbix conf]# cp config.props.sample config.props



To edit a configuration file:



[Email protected] conf]# vim Config.props



Source Configuration file


[root@zabbix conf]# egrep "^[a-Z,1-9]" config.props.sample
 
ZabbixServerList=ZabbixServer1,ZabbixServer2
 
ZabbixServer1.Address=IP_ADDRESS_OF_ZABBIX_SERVER
 
ZabbixServer1.Port=PORT_OF_ZABBIX_SERVER
 
ZabbixServer2.Address=IP_ADDRESS_OF_ZABBIX_SERVER
 
ZabbixServer2.Port=PORT_OF_ZABBIX_SERVER
 
OrabbixDaemon.PidFile=./logs/orabbix.pid
 
OrabbixDaemon.Sleep=300
 
OrabbixDaemon.MaxThreadNumber=100
 
DatabaseList=DB1,DB2,DB3
 
DatabaseList.MaxActive=10
 
DatabaseList.MaxWait=100
 
DatabaseList.MaxIdle=1
 
DB1.Url=jdbc:oracle:thin:@server.domain.example.com:<LISTENER_PORT>:DB1
 
DB1.User=zabbix
 
DB1.Password=zabbix_password
 
DB1.MaxActive=10
 
DB1.MaxWait=100
 
DB1.MaxIdle=1
 
DB1.QueryListFile=./conf/query.props
 
DB2.Url=jdbc:oracle:thin:@server2.domain.example.com:<LISTENER_PORT>:DB2
 
DB2.User=zabbix
 
DB2.Password=zabbix_password
 
DB2.QueryListFile=./conf/query.props
 
DB3.Url=jdbc:oracle:thin:@server3.domain.example.com:<LISTENER_PORT>:DB3
 
DB3.User=zabbix
 
DB3.Password=zabbix_password
 
DB3.QueryListFile=./conf/query.props


After modification


[root@zabbix conf]# egrep "^[a-Z,1-9]" config.props
 
ZabbixServerList=ZabbixServer1 #(the name of zabbixserver, the address and port in the downlink refer to this name, so the prefix names of the following two lines should be consistent with the names here)
 
ZabbixServer1.Address=127.0.0.1 #zabbix server, so here is 127.0.0.1
 
ZabbixServer1.Port=10051 #zabbix server service port
 
OrabbixDaemon.PidFile=./logs/orabbix.pid
 
OrabbixDaemon.Sleep=300
 
OrabbixDaemon.MaxThreadNumber=100
 
DatabaseList=172.20.10.183-oracle,192.168.56.99-oracle #here is very important, corresponding to the following
 
DatabaseList.MaxActive=10
 
DatabaseList.MaxWait=100
 
DatabaseList.MaxIdle=1
 
172.20.10.183-oracle.Url=jdbc:oracle:thin:@172.20.10.183:1521:orcl #172.20.10.183 oracle database address, port 1521, orcl database instance name
 
172.20.10.183-oracle.User=zabbix #Authorized account
 
172.20.10.183-oracle.Password=zabbix #Authorized password
 
172.20.10.183-oracle.MaxActive=10
 
172.20.10.183-oracle.MaxWait=100
 
172.20.10.183-oracle.MaxIdle=1
 
172.20.10.183-oracle.QueryListFile=./conf/query.props #The statements to be queried are defined here, not satisfied with their own changes



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



[oracle@oracle ~]$ sqlplus / as sysdba
 
  
 
SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 7 18:01:54 2016
 
Copyright (c) 1982, 2011, Oracle. All rights reserved.
 
Connected to:
 
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
 
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL>
 
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;
 
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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.