Home Directory Plugins Databases MySQL check_mysql_count

Search Exchange

Search All Sites

Nagios Log Server Now Available - Download Now

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

check_mysql_count

Bookmark and Share

Rating
3 votes
Favoured:
0
Current Version
0.02
Last Release Date
2011-11-21
Compatible With
  • Nagios 2.x
  • Nagios 3.x
License
GPL
Hits
87178
Check row count in table. Possible to specify WHERE conditionals.
Check row count in table. Possible to specify WHERE conditionals and CRIT and WARN count.
Reviews (1)
bykristan, May 12, 2010
1 of 2 people found this review helpful
This script has fulfilled a check we need so I thought I'd share a slight addition:
after the line

$status = "Rows $state - $count rows\n";

add

if ($count =~ m/\D/) { $state = "CRITICAL"; $status = "$count \n"; }

This returns the MySql error (if there is one) rather than just returning OK when unable to connect to the server or the check is not correct...

Also the condition needs to be an escaped string - ie.
host=\"localhost\" or if using NagiosQL to configure Nagios: host=\\\"localhost\\\"