Monitoring duration of DB2 deadlocks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Monitoring duration of DB2 deadlocks

Post by awilson »

Hi. I'm writing to see if anyone has worked out a way to monitor the duration of DB2 deadlocks. I will test the check_db2_health script on the exchange, but it monitors for deadlocks per second, rather than the duration.

Thanks!
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitoring duration of DB2 deadlocks

Post by mbellerue »

Putting a monitor on the duration of deadlocks sounds like a great idea. The check_db2_health plugin in the Exchange has a flag for lock-waiting, but lock waits seem like they may be somewhat different from deadlocks...?

I did stumble across this post on Stack Overflow.
https://stackoverflow.com/questions/490 ... ock-in-db2

Specifically, this message.
Yes that means no deadlock. If there was a deadlock and the event monitor was active at the time, then you should see a "Deadlock Event" stanza in the db2evmon output. You can also use the monitoring functions to confirm if a deadlock happened (but not how it happened). The following query reports cumulative values since database-activation:

Code: Select all

SELECT deadlocks, lock_timeouts FROM TABLE (MON_GET_DATABASE(-2));
So it looks like there may be ways to monitor the deadlock event. Maybe they either include duration information, or a way to determine the duration. At which point, you could create a plugin.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Monitoring duration of DB2 deadlocks

Post by awilson »

Thank you very much! I'll try the method mentioned in the article.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Monitoring duration of DB2 deadlocks

Post by mbellerue »

Cool! Do you want to leave this thread open, or should we close it?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Monitoring duration of DB2 deadlocks

Post by awilson »

We can close it. Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Monitoring duration of DB2 deadlocks

Post by scottwilkerson »

awilson wrote:We can close it. Thanks
Great!

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