Page 1 of 2

NagiosXI install_driver(DB2) failed

Posted: Tue Dec 09, 2014 6:08 am
by paulol
I have install the check_db2_health from the site http://labs.consol.de/lang/en/nagios/check_db2_health/
For that, I first install the dsdriver (v9.5)
then Perl-Module DBD::DBI (v1.632) installation via perl -MCPAN -e 'install DBI'
and finally PERL DBD::DB2 (v1.85) manual installation (Download the latest DBD::DB2 driver source from http://search.cpan.org/~ibmtordb2/)

I have installed that on the nagios xi server
On this server, the command line works fine :
as root or as the user "nagios" :

/usr/local/nagios/libexec/check_db2_health --hostname X.X.X.X --port XXXXX --username XXXXX --password XXXXXX --mode last-backup --database XXXXXX
CRITICAL - last backup of db XXXXXX was 8.90 days ago | last_backup=8.90;1;2

But, when this action is launch by NagiosXI, the result is :

install_driver(DB2) failed: Can't load '/usr/local/lib64/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/lib64/perl5/DynaLoader.pm line 200.
at (eval 4) line 3
Compilation failed in require at (eval 4) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /usr/local/nagios/libexec/check_db2_conexao.pl line 32

The files "/usr/local/lib64/perl5/auto/DBD/DB2/DB2.so" exists on nagios xi server

-r-xr-xr-x 1 root root 285594 Dec 8 01:43 /usr/local/lib64/perl5/auto/DBD/DB2/DB2.so

If you want to test better i sent a script to test connection on DB2 via perl.

Env:
Linux CentOS 6.6 - 64bits
Nagios XI Manual Installation.

Re: NagiosXI install_driver(DB2) failed

Posted: Tue Dec 09, 2014 5:50 pm
by abrist
Do any of the parameters ($ARGn$s, etc) use illegal meta characters like !, $, ^, etc?

Re: NagiosXI install_driver(DB2) failed

Posted: Wed Dec 10, 2014 9:22 am
by paulol
Nope.

Example:

/usr/local/nagios/libexec/check_db2_health --hostname X.X.X.X --port 50000 --username nagios --password nagios --mode last-backup --database dbpd07

Re: NagiosXI install_driver(DB2) failed

Posted: Wed Dec 10, 2014 1:28 pm
by lmiltchev
Can you run the following command to show us the plugin's usage?

Code: Select all

/usr/local/nagios/libexec/check_db2_health -h
Note: Not sure if I have the same version of the plugin on my testbox, but this is the usage I see:
Usage:
check_db2_health [-v] [-t <timeout>] --hostname <dbhost> --port <dbport,def: 50000>
--username=<username> --password=<password> --mode=<mode>
--database=<database>
check_db2_health [-h | --help]
check_db2_health [-V | --version]
Can you try the following?

Code: Select all

/usr/local/nagios/libexec/check_db2_health --hostname X.X.X.X --port 50000 --username=nagios --password=nagios --mode=last-backup --database=dbpd07

Re: NagiosXI install_driver(DB2) failed

Posted: Thu Dec 11, 2014 10:45 am
by paulol

Code: Select all

./check_db2_health -version

check_db2_health (1.0.9.2)
This nagios plugin comes with ABSOLUTELY NO WARRANTY. You may redistribute
copies of this plugin under the terms of the GNU General Public License.

Code: Select all

/usr/local/nagios/libexec/check_db2_health --hostname X.X.X.X --port 50000 --username=nagios --password=nagios --mode=last-backup --database=dbpd07
CRITICAL - last backup of db dbpd07 was 11.11 days ago | last_backup=11.11;1;2

Re: NagiosXI install_driver(DB2) failed

Posted: Thu Dec 11, 2014 1:14 pm
by tgriep
Could you post the contents of the service check you are using in XI?

Re: NagiosXI install_driver(DB2) failed

Posted: Thu Dec 11, 2014 1:59 pm
by cmerchant
For the check_db2_health that you tried from XI, try not using the Test Check Command. Could you save the check, and apply config and go into Home --> services, (select your check, and perform an schedule a forced immediate check). Test Check should be used for simple checks that don't involve dynamic libraries that might not be set up in apache, unless you want to mess with httpd.conf and setenv LD_LIBRARY_PATH.

I will include some reference links to monitoring DB2 with nagios: (some dated but relevant)

http://www.r71.nl/kb/326-nagios-monitor ... 2-database

This one I found by doing a search on your error message:

http://www.justskins.com/forums/dbi_db2 ... 19417.html

Re: NagiosXI install_driver(DB2) failed

Posted: Fri Dec 12, 2014 12:11 pm
by paulol
tgriep, following:

Code: Select all

define command {
       command_name                             check_db2
       command_line                             $USER1$/check_db2_health --hostname $HOSTADDRESS$ --port $ARG1$ --username nagios --password nagios --mode $ARG2$ --database $ARG3$
}

define host {
        host_name                       SERVER1
        use                             Linux_Servers
        alias                           DB Server
        address                         X.X.X.X
        hostgroups                      Linux_Servers
        register                        1
        }

define service {
        host_name                       SERVER1
        service_description             Backup DB
        check_command                   check_db2!50000!last-backup!dbpd07!!!!!
        max_check_attempts              1
        check_interval                  60
        retry_interval                  60
        check_period                    24x7
        notification_period             24x7
        notifications_enabled           0
        contact_groups                  Equip_DB
        register                        1
        }

Re: NagiosXI install_driver(DB2) failed

Posted: Fri Dec 12, 2014 1:11 pm
by paulol
cmerchant,

I have working with nagios core for 5 years. Now i'm migrating to nagios xi. In the nagios core this check "check_db2_health" works fine. But in the Nagios XI does not, i dont know why.

Nagios Core - Debian Squeeze
Nagios XI - Centos 6.6

Following
nagios core cgi image ( This works.)
nagios xi cgi image (does not works)
Apache conf http. (Apacheconf from Nagios XI server)

Re: NagiosXI install_driver(DB2) failed

Posted: Fri Dec 12, 2014 2:47 pm
by slansing
Have you made sure that you have the DBD::DB2 module installed properl? As mentioned here:

https://labs.consol.de/nagios/check_db2_health/

That is a pre-requisite, though you mentioned you had gone through that step, can you double-check?