NagiosXI install_driver(DB2) failed

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

NagiosXI install_driver(DB2) failed

Post 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.
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: NagiosXI install_driver(DB2) failed

Post by abrist »

Do any of the parameters ($ARGn$s, etc) use illegal meta characters like !, $, ^, etc?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: NagiosXI install_driver(DB2) failed

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NagiosXI install_driver(DB2) failed

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: NagiosXI install_driver(DB2) failed

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NagiosXI install_driver(DB2) failed

Post by tgriep »

Could you post the contents of the service check you are using in XI?
Be sure to check out our Knowledgebase for helpful articles and solutions!
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: NagiosXI install_driver(DB2) failed

Post 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
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: NagiosXI install_driver(DB2) failed

Post 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
        }
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: NagiosXI install_driver(DB2) failed

Post 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)
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: NagiosXI install_driver(DB2) failed

Post 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?
Locked