Page 1 of 1

check_db2_health

Posted: Mon Mar 19, 2012 6:03 am
by qytmnet
I have great difficulties to get this plugin work on the nagios image I download from , it requires to have perl DDB::DB2 module.

I downloaded from CPAN website http://httpupdate37.cpanel.net/CPAN/aut ... .83.tar.gz, but when I run make, I have

Constatns.xs:16:20 error: sqlcli.h: No such file or directory
Constatns.xs:18:21 error: sqlcli1.h: No such file or directory

Any ideas?

Thanks
Yan

Re: check_db2_health

Posted: Mon Mar 19, 2012 10:46 am
by nscott
You typically have to install the client libraries for DB2 on the actual Nagios instance. Not the DB2 database itself, just the client libraries. When you install these it will also probably set some of the environment variables in your Linux environment. These would be a good start to try:

http://www.ibm.com/services/forms/preLo ... wg-idsoc97

Re: check_db2_health

Posted: Tue Mar 20, 2012 8:58 am
by qytmnet
Many thanks for your reply, Nicholas.

I have managed to download the library and installed DBD::DB2 and plugin check_db2_health works on my nagios server.

When I run command on Nagios server, it works.

But when I add services to Nagios interface, I have

CRITICAL - cannot connect to wcsts03. install_driver(DB2) failed: Can't load '/usr/local/lib/perl5/auto/DBD/DB2/DB2.so' for module DBD::DB2: libdb2.so.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/DynaLoader.pm line 200.

I guess it has something to do with my command "$USER1$/check_db2_health --hostname ......". I checked /usr/local/nagios/etc/resource.cfg, I have $USER1$ set to /usr/local/nagios/libexec.

Any ideas what do I need to do please? Thanks

Re: check_db2_health

Posted: Wed Mar 21, 2012 10:06 am
by qytmnet
I have tried to setenv in httpd.conf to make sure LD_LIBRARY_PATH, and it still doesn't work.

Any help would be much appreciated. Thanks.

Re: check_db2_health

Posted: Wed Mar 21, 2012 11:05 am
by scottwilkerson
qytmnet wrote:I have tried to setenv in httpd.conf to make sure LD_LIBRARY_PATH, and it still doesn't work.

Any help would be much appreciated. Thanks.
You will likely need to do this in the script itself. Nagios doesn't run the check commands from apache, so setting it in httpd.conf will not help.