I think we all know that Nagios monitors the DB2 database using the Check_db2_oracle plugin, but before using it, you need to install the runtime environment on the Nagios server. In combination with my own many tests, I focused on how to install the plug-in check_db2_oracle in a CenOS6.7 64bit environment. Ok, talk less. Let ' s do it!
1.cenos6.7 environment for installing plug-ins check_db2_oracle.
First step: Installing DBI, using the command: perl-mcpan-e ' Install DBI '
Step Two: Install libstdc++, use command: Yuminstall libstdc++-devel.i686
Step three: Install Pam, using the command: Yuminstall pam-devel.i686
Fourth step: Install the Ibmdata Server Runtime Client. The corresponding version is Linux AMD64 and Intel em64t,version XX. X. The default installation Db2_home is:/opt/ibm/db2/vxx. X
Fifth Step: Add environment variable: EXPORTDB2_HOME=/OPT/IBM/DB2/VXX. X;export ld_library_path=/opt/ibm/db2/vxx. X/lib64
Sixth step: Create groups and Accounts:
1) GROUPADDDB2GRP1
2) GROUPADDDB2FGRP1
3) GROUPADDDASADM1
4) useradd-g db2grp1-m-d/home/db2inst1 Db2inst1
5) useradd-g db2fgrp1-m-d/home/db2fenc1 db2fenc1
6) useradd-g dasadm1-m-D/HOME/DASUSR1 DASUSR1
7)/opt/ibm/db2/v11.1/instance/db2icrtdb2inst1
Seventh step: Install ibm_data_server_driver_package_linuxx64
1)tar zxf ibm_data_server_driver_package_linuxx64_v11.1.tar.gz
2) Cddsdriver
3). /installdsdriver
4) mvinclude/opt/ibm/db2/vxx. x/Note: This step is primarily to prevent installation dbd-db2-1.85 to appear similar to the following error message:
>constants.xs:16:20:sqlcli.h:no such file or directory
> constants.xs:16:20:sqlcli1.h:no such file or directory
> constants.xs:16:20:sqlext.h:no such file or directory
Eighth step: Install dbd-db2-1.85
1)tar zxf dbd-db2-1.85.tar. GZ
2)CD dbd-db2-1.85
3)perl makefile.pl
4) Make
5) Maketest
6) Makeinstall
Successful completion of the above eight steps means that the operating environment of the Check_db2_oracle has been completed. Below we will run check_db2_oracle.
2. Thecheck_db2_oracleinstalled in the appropriate directory, mine is under the/usr/local/nagios/libexec. In the Runcheck_db2_oracle, the environment variables need to be loaded:exportdb2_home=/opt/ibm/db2/vxx. X;export ld_library_path=/opt/ibm/db2/vxx. X/lib64
./check_db2_health--hostname xxxx--port 50000--username=xxxx--password=xxxx--database=xxxx--mode=lock-waits
Results:
OK-0.001567 Lock Waits/sec | lock_waits_per_sec=0.001567;10;100
In addition, about check_db2_health download and its own function introduction, you can refer to https://labs.consol.de/nagios/check_db2_health/
This article is from the "Alex Gump blog" blog, please be sure to keep this source http://alexgan.blog.51cto.com/1023260/1860029
Nagios Monitoring Database Db2--check_db2_health