Page 1 of 1

How to monitor Database Blocking sessions

Posted: Mon Jan 06, 2020 1:17 am
by Pratapa
How to monitor Database Blocking sessions.

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

Regards,
Pratapa

Re: How to monitor Database Blocking sessions

Posted: Mon Jan 06, 2020 2:58 pm
by lmiltchev
What kind of DB are you talking about - MSSQL, Oracle, etc.?

Re: How to monitor Database Blocking sessions

Posted: Sun Jan 12, 2020 11:50 pm
by Pratapa
It is Oracle database.

Re: How to monitor Database Blocking sessions

Posted: Mon Jan 13, 2020 2:32 pm
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