Page 1 of 1
dead lock for DB2
Posted: Wed Feb 02, 2022 8:11 am
by deek
Hi Team ,
Is there a plugin to monitor the dead locks on DB2 server . I was not able to find any plugins .
I have plugins for Lock wait and Database connection but i was not able to find any plugin to monitor Dead locks .
Re: dead lock for DB2
Posted: Thu Feb 03, 2022 10:05 am
by ssax
This one here looks to support it:
https://labs.consol.de/nagios/check_db2_health/
You can set it up and test it like this:
Code: Select all
wget https://labs.consol.de/assets/downloads/nagios/check_db2_health-1.1.3.tar.gz
tar zxf check_db2_health-1.1.3.tar.gz
cd check_db2_health-1.1.3
./configure
make all
make install
Code: Select all
/usr/local/nagios/libexec/check_db2_health -t 60 --host <dbhost> --port <dbport,def: 50000> --username=<username> --password=<password> --mode=deadlocks --database=<database>
See here for the help section that lists other modes and other options:
Code: Select all
/usr/local/nagios/libexec/check_db2_health -h
Re: dead lock for DB2
Posted: Tue Feb 08, 2022 12:25 pm
by deek
Hi Team ,
Looks like I need to install DBD::DB2 module .
[nagios@abclibexec]$ ./check_db2_health -t 60 --host xyz--port 5000 --username=deek--password=pwd --mode=deadlocks --database=IADB
CRITICAL - cannot connect to xyz. install_driver(DB2) failed: Can't locate DBD/DB2.pm in @INC (you may need to install the DBD::DB2 module) (@INC contains: . /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at (eval 12) line 3.
Perhaps the DBD::DB2 perl module hasn't been fully installed,
or perhaps the capitalisation of 'DB2' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Mem, Sponge, mysql.
at ./check_db2_health line 2632.
Re: dead lock for DB2
Posted: Tue Feb 08, 2022 8:40 pm
by ssax
What is the output of this command?
Re: dead lock for DB2
Posted: Tue Feb 08, 2022 11:40 pm
by deek
When I executed the command im getting below prompt .
[nagios@abclibexec]$ cpan -i DBD::DB2
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes] ^C
When i gave Yes it started installing but I guess the installation was not successful . Are there any other commands also to be executed ?
Capture_DB2.PNG
Re: dead lock for DB2
Posted: Wed Feb 09, 2022 4:45 pm
by ssax
Those cpan settings will cause issues because you can see it's installing only for the nagios user, you should be installing it either as root or setup cpan to not install to user-specific locations.
What is the output of these commands as root?
Code: Select all
uname -a
cat /etc/*release
env
su - nagios
env
Based on the DB2 output I think you would need to install the DB2 client software and then set this:
Code: Select all
export DB2_HOME='/path/to/your/db2/client'
Then as root:
Re: dead lock for DB2
Posted: Fri Feb 11, 2022 8:56 am
by deek
If possible can you provide the commands to install the DB2 client software .
Re: dead lock for DB2
Posted: Fri Feb 11, 2022 5:40 pm
by ssax
You would need to reach out to your Sybase vendor/support for the client, I searched Google but it looks like they are not publicly available. They should have instructions for installing them on the system.