Zabbix using Orabbix plugin to monitor Oracle database (enhanced version)

Source: Internet
Author: User

According to some of the information on the Internet to install the last found a lot of problems, so they fixed some of the problems recorded down.

I. Installation of the JDK (Orabbix Server)

1. Unzip the software and put it in a fixed position

Tar zxf jdk-8u51-linux-x64.tar.gzmv jdk1.8.0_51//usr/local/

2. Set system variables, edit/etc/profile add at end

Export java_home=/usr/local/jdk1.8.0_51exportclasspath= $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarexport PATH = $JAVA _home/bin: $PATH

3. Implement the/etc/profile to make it effective

Source/etc/profile


Two. Increase the monitoring user in Oracle and set the appropriate user rights, this step is done in Sqlplus (Oracle server)

Su-oraclesqlplus/as sysdbasql>create USER zabbixidentified by Zabbix_passworddefault TABLESPACE USERSTEMPORARY TABL ESPACE tempprofile Defaultaccount UNLOCK;

Give Zabbix users the appropriate permissions

grant alter session to zabbix; grant create session to zabbix; grant connect to zabbix; alter user zabbix default role all; grant select on v_$instance to zabbix; grant select on dba_users to zabbix; grant select on v_$log_history to zabbix; grant select on v_$log to zabbix; grant select on v_$parameter to zabbix; Grant select on sys. dba_audit_session to zabbix; grant select on v_$lock to zabbix; grant select on dba_registry to zabbix; grant select on v_$librarycache to zabbix; grant select on v_$sysstat to zabbix; grant select on v_$parameter to zabbix; grant select on v_$latch to zabbix; Grant select on v_$pgastat to zabbix; grant select on v_$sgastat to zabbix; grant select on v_$librarycache to zabbix; grant select on v_$process to zabbix; grant select on dba_data_files to zabbix; grant select on dba_temp_files to zabbix; grant select on dba_free_space to zabbix; grant select on v_$system_event to zabbix; Grant select on v_$locked_object to zabbixgrant select on dba_objects  TO ZABBIX; grant select on dba_tablespaces to zabbix; grant select on v_$session to zabbix;

Some of the above are part of the lower case that I have added to other articles

If the database is 11G, also perform the following sections:

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;

Three. Installing Orabbix (Orabbix Server)

In fact, Orabbix only need to install on a single server, I chose to install on Zabbix server, of course, the above JDK is for Orabbix service, because Orabbix is an Oracle client to find data in Oracle, and pass it on to Zabbix.

Mkdir/usr/local/orabbixcd/usr/local/orabbixwget Orabbix http://nchc.dl.sourceforge.net/project/orabbix/ Orabbix-1.2.3.zipunzip orabbix-1.2.3.zipchmod +x run.shcp init.d/orabbix/etc/init.d/sed-i ' s#/opt/orabbix#orabbix=/ Usr/local/orabbix#g '/etc/init.d/orabbixchmod +x/etc/init.d/orabbixsed-i ' s#java#/usr/local/jdk1.8.0_51/bin/java# G '/usr/local/orabbix/run.sh# to resolve/usr/local/orabbix/run.sh:line 2:java:command not found this error

Configure Orabbix to enter the/usr/local/orabbix/conf/directory

Cd/usr/local/orabbix/conf

CP Config.props.sample Config.props

zabbixserverlist=zabbixserverzabbixserver.address=192.168.0.81zabbixserver.port=10051orabbixdaemon.pidfile=./ logs/orabbix.pidorabbixdaemon.sleep=300orabbixdaemon.maxthreadnumber=100databaselist= Tpy100databaselist.maxactive=10databaselist.maxwait=100databaselist.maxidle=1tpy100. Url=jdbc:oracle:thin:@192.168.0.209:1521:orcltpy100. User=zabbixtpy100.password=zabbixtpy100. Maxactive=10tpy100. Maxwait=100tpy100. Maxidle=1tpy100. Querylistfile=./conf/query.props

It is important to note thatDatabaselist=crmdbrefers to the name of the server being monitored, and the name of theZabbixserverThe machine name in the interface is consistent, and the settings referenced in the configuration file follow that name.
Crmdb. URL=JDBC:ORACLE:THIN:@192.168.0.209:1521:ORCLSpecifies the connection information for the monitored server (for example, using theJDBCconnection, the server address is192.168.0.209,Oraclethe port is1521,ORCLrefers toinstances of the database)

The default is similar to the above steps, but after you import the template you will find that the monitoring project is not complete, such as dbsize and dbfilesize these categories, Orabbix by default does not open the database size, need to configure Query.props

Edit/usr/local/orabbix/conf/query.props File

Add Dbfilesize,dbsize to the querylist= category,

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/77/A7/wKiom1ZqjZGQBymTAAENezZyqGI805.jpg "title=" 12.jpg "alt=" Wkiom1zqjzgqbymtaaenezzyqgi805.jpg "/>

Then at the end of the file, add

Dbfilesize. Query=select to_char (SUM (BYTES/1024/1024/10), ' FM99999999999999990 ') RetValue from Dba_data_filesdbsize. Query=select to_char (SUM (NVL (A.BYTES/1024/1024/10-NVL (F.BYTES/1024/1024/10, 0), 0), ' FM99999999999999990 ') RetValue from Sys.dba_tablespaces D, (select Tablespace_name, sum (bytes) bytes from Dba_data_files GROUP by Tablespace_nam e) A, (select Tablespace_name, sum (bytes) bytes from Dba_free_space Group by tablespace_name) F WHERE d.tablespace_name = A.tablespace_name (+) and D.tablespace_name = F.tablespace_name (+) and not (D.extent_management like ' LOCAL ' and d.content s like ' temporary ')

SQL statement to define query Dbfilesize,dbsize

At this point, we can start the Orabbix service.

Service Orabbix Start

Check the service PS aux |grep orabbix|wc-l if equal to 2 indicates that the success of the start, the start of success is not necessarily no problem, this time need to view the log

/usr/local/orabbix/logs/orabbix.log

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/77/A7/wKiom1Zqj4SRX_L6AAdiQaHLJBY087.jpg "title=" Err.jpg "alt=" Wkiom1zqj4srx_l6aadiqahljby087.jpg "/>

From the above can see me a lot of data is not caught, because the permissions of the problem cannot find the table, so you need to use Query.props

/usr/local/orabbix/conf/query.props

Find the corresponding table, as shown here for the archive table

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/77/A7/wKiom1ZqkLzB8TkHAAB1tEcr--0828.jpg "title=" 25.jpg "alt=" Wkiom1zqklzb8tkhaab1tecr--0828.jpg "/>

If you do not have permissions, you need to grant permissions to the database with DBA authority

GRANT SELECT on V_$log to ZABBIX;

Can

This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1722118

Zabbix using Orabbix plug-ins to monitor Oracle Database (Enhanced Edition)

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.