Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
qippur
byqippur, June 12, 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
=======
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
=======