How to monitor Database Blocking sessions

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Pratapa
Posts: 150
Joined: Tue Oct 01, 2019 1:33 am

How to monitor Database Blocking sessions

Post by Pratapa »

How to monitor Database Blocking sessions.

Is there a plungin for this.If yes, Please provide the plugin.

Regards,
Pratapa
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to monitor Database Blocking sessions

Post by lmiltchev »

What kind of DB are you talking about - MSSQL, Oracle, etc.?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pratapa
Posts: 150
Joined: Tue Oct 01, 2019 1:33 am

Re: How to monitor Database Blocking sessions

Post by Pratapa »

It is Oracle database.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: How to monitor Database Blocking sessions

Post by lmiltchev »

The older check_oracle_health plugins didn't have a "blocking-session" mode, but the newer ones do:

https://labs.consol.de/nagios/check_ora ... index.html

From the changelog:
3.2.1 - 2019-10-10
add mode blocking-sessions (Thanks dbmasters.at for the sql)
You could backup your "old" plugin (just in case), then download, and compile the latest version (3.2.1.1) on your nagios machine. Test it from the command line to make sure it works. You could run something like this:

Code: Select all

/usr/local/nagios/libexec/check_oracle_health --connect 'x.x.x.x:1521/yyyy' --username 'username' --password 'password' --mode sql --name="select count(*) from Gv\$"$"session where blocking_session is not NULL order by blocking_session" --warning 50 --critical 200
or

Code: Select all

/usr/local/nagios/libexec/check_oracle_health --connect 'x.x.x.x:1521/yyyy' --username 'username' --password 'password' --mode sql --name="select count(*) from v\$session where blocking_session is not NULL order by blocking_session" --warning 50 --critical 200
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked