Setting up check_db2_health

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Setting up check_db2_health

Post by mejokj »

So I have been trying for two days to get check_db2_health to work without any luck. Here's where I am stuck at the moment:

Code: Select all

[nagios@nagios root]$ /usr/local/nagios/libexec/check_db2_health --hostname 192.168.2.10 --port 35001 --username=nagios  --password=nagios --mode=connection-time --database=testdb

CRITICAL - cannot connect to  192.168.2.10. Total Environment allocation failure!  Did you set up your DB2 client environment?

The IBM documentation (https://www.ibm.com/support/knowledgece ... lient.html) says:

For the DB2 client, you must set the environment variables.
For Linux systems, add the environment variables to the bash_profile file of the user.

Set the following environment variables.
DB2DIR= /opt/ibm/db2/V10.5 (Default DB2 directory)
DB2INSTANCE=db2inst1 (default)
INSTHOME=/home/db2inst1
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTHOME/sqllib/lib
NLS_LANG

But after installing the client, I don't see a sqllib directory anywhere. I am also not sure which DB2 client package I have to install on the Nagios server and I have tried all the below.

I am confused with the multiple options listed here: http://www.db2dean.com/Previous/DB2Client.html

Which one of these do I need?
IBM Data Server Driver Package (DS Driver)
IBM Data Server Runtime Client
IBM Data Server Client

I believe that I have installed the Perl DBD::DB2 module correctly, or the error when I run the plugin would be different.

This is my first time trying to configure Nagios to monitor DB2 so any suggestions would be appreciated.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Setting up check_db2_health

Post by ssax »

I believe you just need this one:

Code: Select all

IBM Data Server Runtime Client
Does this output anything?

Code: Select all

find / -name sqllib
You may need to add those to /etc/environment on the XI server for them to be processed.
mejokj
Posts: 353
Joined: Mon Jul 22, 2013 10:31 pm

Re: Setting up check_db2_health

Post by mejokj »

We got it to work, but it wasn't easy:

1. Install IBM Data server runtime client(ibm_data_server_runtime_client_linuxx64_v11.1.tar.gz) on Nagios server.

2. Install the DB2 server(not client) on another Linux server and then copied the sqllib directory to /opt/ibm/db2/V11.1 on Nagios server. I am not sure if this is the right way, but we couldn't find the sqllib directory anywhere else.

3. Set the following environment variables:

Code: Select all

export DB2_HOME=/opt/ibm/db2/V11.1  
export DB2LIB=$DB2_HOME/lib64  
export LD_LIBRARY_PATH=$DB2LIB:$LD_LIBRARY_PATH 
4. Test

Code: Select all

[root@nagiosxi libexec]# /usr/local/nagios/libexec/check_db2_health --hostname 192.168.0.119 --port 50000 --username=lcuser  --password=password --mode=connection-time --database=SAMPLE WARNING - 2.33 seconds to connect as LCUSER   | connection_time=2.3264;1;5
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Setting up check_db2_health

Post by scottwilkerson »

mejokj wrote:We got it to work, but it wasn't easy:
Great! Thanks for sharing your solution.

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked