check_oracle_health
Monitoring Oracle Database
To Create monitoring of Oracle database Follow below steps.Step 1: To Download Below Rpms Click Here.....
oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
oracle-instantclient12.1-jdbc-12.1.0.1.0-1.x86_64.rpm
Step 2: After Downloading rpms Install them on Nagios Server.
Fist install below pacages: libdbi-drivers and libdbi perl-DBI libaio
[root@nagios_master ~]# yum install libdbi-drivers libdbi perl-DBI libaio
Now install oracle packages.
[root@nagios_master ~]# rpm -ivh oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-jdbc-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
Now set ORACLE HOME
[root@nagios_master ~]# echo 'export ORACLE_HOME=/usr/lib/oracle/12.1/client64/' /etc/profile
[root@nagios_master ~]# echo 'export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/' >> /etc/profile
[root@nagios_master ~]# mkdir -p /usr/lib/oracle/12.1/client64/lib/network/admin/ && echo 'names.directory_path = (TNSNAMES,EZCONNECT)' > /usr/lib/oracle/12.1/client64/lib/network/admin/sqlnet.ora
[root@nagios_master ~]# chmod 777 /tmp/check_oracle_health
Now execute cpan command prompt and install DBD-Oracle
[root@nagios_master ~]# cpan
cpan[1]> install DBD::Oracle
Step 3: Now download Check_oracle_health plugin from below link:
http://labs.consol.de/download/shinken-nagios-plugins/check_oracle_health-1.7.8.1.tar.gz
[root@nagios_master ~]# tar -xvf check_oracle_health-1.7.8.1.tar.gz
[root@nagios_master ~]# cd check_oracle_health-1.7.8.1
[root@nagios_master ~]# ./configure --with-statefiles-dir=/tmp/ --with-nagios-user=nagios --with-nagios-group=nagios --with-mymodules-dir=/usr/local/nagios/libexec/plugins/ --with-mymodules-dyn-dir=/usr/local/nagios/libexec/plugins/
[root@nagios_master ~]# make && make install
Then, create a dedicated user for monitoring, connect to your Oracle database and enter the following lines:
CREATE USER nagios IDENTIFIED BY nagios ;
GRANT CREATE SESSION TO nagios;GRANT SELECT any dictionary TO nagios;GRANT SELECT ON V_$SYSSTAT TO nagios;GRANT SELECT ON V_$INSTANCE TO nagios;GRANT SELECT ON V_$LOG TO nagios;GRANT SELECT ON SYS.DBA_DATA_FILES TO nagios;GRANT SELECT ON SYS.DBA_FREE_SPACE TO nagios;
[root@nagios_master ~]# /usr/local/nagios/libexec/plugins/check_oracle_health --connect=xxx.xxx.xxx.xxx/ORCL --username=nagios --password=nagios --tablespace=SUPERVISION --mode tablespace-usage
CRITICAL - tbs SYSTEM usage is 90%
2 comments:
Hi Shankar,
Thank you so much for the post. It was very helpful. I tried the same steps, but I am facing the below error.
[root@lbaynagtestap01 libexec]# ./check_oracle_health --connect=nagios/******@DNBT21 --username=nagios --password=oradbmon --tablespace=USERS --mode tablespace-usage
CRITICAL - cannot connect to nagios/***@DNBT21. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
at (eval 14) line 3.
Compilation failed in require at (eval 14) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./check_oracle_health line 6155.
CRITICAL - cannot connect to nagios/***@DNBT21. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
at (eval 14) line 3.
Compilation failed in require at (eval 14) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./check_oracle_health line 6155.
CRITICAL - cannot connect to nagios/***@DNBT21. install_driver(Oracle) failed: Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 190.
I am new to nagios. I am not able to fix it. Please help me with it.
Install perl-dbd package for oracle
Post a Comment