Steps to install Zabbix_orabbix monitoring

Source: Internet
Author: User
Tags chmod file size

Official Configuration Address: Http://www.smartmarmot.com/wiki/index.php?title=Orabbix




1. Create user ZABBIX identified by ZABBIX on the monitored side and create ZABBIX dedicated tablespace


GRANT Connect,resource to ZABBIX;
Grant create session to ZABBIX;
Grant create tablespace to ZABBIX;


Conn Zabbix/zabbix;


CREATE tablespace Orabbix datafile
'/u01/app/oracle/oradata/posp/orabbix.dbf ' SIZE 1G autoextend on NEXT 1G MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL autoallocate
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK on;


Conn Sys/sys as SYSDBA;


Alter USER ZABBIX
Identified by ZABBIX
DEFAULT tablespace Orabbix
Temporary tablespace TEMP
Profile DEFAULT
Account UNLOCK;


2. Install JDK package, dependent on Java
Go to official website to download


3. Create a corresponding directory
Orabbix The default configuration is/opt/orabbix, the relevant content will be in this folder, if you specify a different directory at the time of installation, remember to change to the correct file path in the configuration file.
Mkdir–p/opt/orabbix
Cd/opt/orabbix


4. Install the Orabbix package
Unzip Orabbix-1.2.3.zip
CP init.d/orabbix/etc/init.d/
chmod +x run.sh
chmod +x/etc/init.d/orabbix


5. Create a user in the data and authorize




GRANT ALTER SESSION 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_$parameter to ZABBIX;
GRANT SELECT on SYS. Dba_audit_session to ZABBIX;


GRANT SELECT on V_$lock to ZABBIX;
GRANT SELECT on V_$locked_object 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 any DICTIONARY to ZABBIX;
GRANT UNLIMITED tablespace to ZABBIX;
GRANT SELECT any TABLE to ZABBIX;
GRANT SELECT any secuence to ZABBIX;
Grant SELECT any TRANSACTION to ZABBIX;


Grant execute on Dbms_lock to ZABBIX;
Revoke execute on Dbms_lock from ZABBIX;
Revoke DBA from ZABBIX;


Orabbix executed those statements.
https://github.com/sboschman/orabbix/blob/master/src/main/conf/query.props.extended


6. If it is a 11G database version, you also need to execute the following statement open ACL access control, or in the process of monitoring some of the content will not display properly (for example, database version, database file size, etc.), and the Orabbix log display also has the following error message.




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




After the settings are complete, you can view the added status by using the following statement.


Select Utl_inaddr.get_host_name (' 127.0.0.1 ') from dual;




7. Configuration Files
Orabbix all the configuration files are in the Conf directory, you need to copy the default profile config.props.sample and then modify and configure it.


CD conf
CP Config.props.sample Config.props
Vim Config.progs




Zabbixserverlist=zabbixserver
zabbixserver.address=10.21.255.236
zabbixserver.port=10051
Orabbixdaemon.pidfile=./logs/orabbix.pid
orabbixdaemon.sleep=300
orabbixdaemon.maxthreadnumber=100
Databaselist=crmdb
databaselist.maxactive=10
databaselist.maxwait=100
Databaselist.maxidle=1
Crmdb. url=jdbc:oracle:thin:@10.21.100.5:1521:dsdfdb--Instance Name
Crmdb. User=zabbix
Crmdb. Password=zabbix
Crmdb. maxactive=10
Crmdb. maxwait=100
Crmdb. Maxidle=1
Crmdb. Querylistfile=./conf/query.props


It is important to note that Databaselist=crmdb refers to the name of the monitored server, which is consistent with the machine name in the Zabbix server interface, and the settings referenced in the configuration file are subject to that name.
Crmdb. URL=JDBC:ORACLE:THIN:@192.168.0.209:1521:ORCL Specifies the connection information for the monitored server (for example, a JDBC-based join method, The server address is 192.168.0.209,oracle port is 1521,ORCL refers to the instance of the database)


8. Configure and start the Orabbix service
Chkconfig--add Orabbix
Chkconfig--level 345 Orabbix on
Service Orabbix Start
Tail–f/opt/orabbix/logs/orabbix.log


Problems that you may encounter
[Root@mqserver template]# Service Orabbix start
Starting Orabbix Service:
/opt/orabbix/run.sh:/usr/bin/java:/lib/ld-linux.so.2:bad ELF Interpreter: No file or directory
Workaround:
[Root@mqserver template]# sudo yum install glibc.i686


9. Configure Javahome


Find Java Paths
[Root@localhost ~]# which Java

/usr/bin/java

[Root@localhost ~]# Ls-lrt/usr/bin/java

lrwxrwxrwx. 1 root root 15:12/usr/bin/java-/etc/alternatives/java

[Root@localhost ~]# Ls-lrt/etc/alternatives/java

lrwxrwxrwx. 1 root root 15:12/etc/alternatives/java/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java




Configure Javahome
Vi/etc/profile
Export Java_home=/usr/java/jdk1.8.0_60/bin/java
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $JAVA _home/bin: $PATH




Configuring soft connections
Ln-s/usr/java/jdk1.8.0_60/bin/java Java




10. Installing Zabbix
zabbix-agent-3.2.6-1.el6.x86_64.rpm
Configuring Zabbix Config
Start the service
/etc/init.d/zabbix-agent Restart (CENTOS6 version start mode)
Systemctl Restart Zabbix-agent.service (CENTOS7 version start mode)


11. Import a template
Configure = = = Template = = = Import Template


12. Add the host (the name must match the configuration of the name defined in Config.props)
(The host name must be consistent with the DATABASELIST=DB_QM in the configuration).


13. The host and template name must be correct in the template

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.