MySQL

check_mysql_connections

Description:

Checks the number of connections to a mysql server.

Current Version

Last Release Date

May 28, 2009

Compatible With


Project Files
Project Notes
Checks the number of connections to a mysql server. Shell script. - requires mysqladmin. - requires bash. - requires utils.sh from nagios plugins package
Reviews (2) Add a Review
poroposed patch - PNP4Nagios support
by qippur, June 30, 2011

May I suggest a little patch to support PNP4Nagios? I am quite new at this an I do not know how to do in a different way, so as the patch is very small, I am pasting it here. Hope it can help. roberto ===== --- old/check_mysql_connections 2011-06-13 09:41:19.000000000 +0200 +++ new/check_mysql_connections 2011-06-13 09:46:49.000000000 +0200 @@ -14,6 +14,7 @@ # V1.1.0 gs 20060818 user mysqladmin options # V1.1.1 gs 20070405 fix result calculation # fix by and thanks to Stephan Helas +# 20110613 added PNP4nagios support - Roberto Resecco source /usr/lib/nagios/plugins/utils.sh @@ -84,15 +85,15 @@ CONNS=$((`mysqladmin $MYSQLOPTS processlist 2>/dev/null|wc -l`-4)) if [ $CONNS -ge $CRIT ]; then - echo "CRITICAL: $CONNS/$MAXCONNS mysql connections" + echo "CRITICAL: $CONNS/$MAXCONNS mysql connections|mysqlConnections=$CONNS" exit $STATE_CRITICAL elif [ $CONNS -ge $WARN ]; then - echo "WARNING: $CONNS/$MAXCONNS mysql connections" + echo "WARNING: $CONNS/$MAXCONNS mysql connections|mysqlConnections=$CONNS" exit $STATE_WARNING elif [ $CONNS -ge 0 ]; then - echo "OK: $CONNS/$MAXCONNS mysql connections" + echo "OK: $CONNS/$MAXCONNS mysql connections|mysqlConnections=$CONNS" exit $STATE_OK else - echo "UNKNOWN: Cannot determine number of connections" + echo "UNKNOWN: Cannot determine number of connections|mysqlConnections=$CONNS" exit $STATE_UNKNOWN fi =======



Good plug, but needs a minor change
by steve.lippert, June 30, 2011

Been running this plug-in for a year or two now, but didn't notice until today that it wasn't actually sourcing the utils.sh file. I had to add the full path to line 18 "source /usr/local/nagios/libexec/utils.sh". With out this the status is already returned as "OK" but with the Warning, Critical, or OK text. Now that I have that in place it works like a charm. Probably something I missed when I first started this plugin.



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.3 (3)
Favorites
1
Views
113,656