Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
darkweaver87
bydarkweaver87, March 13, 2014
Good plugin but the percentage is buggy. For host swap check for instance you have to check against the host total swap usable. For instance I got an alert because my ESX is using 20MB of swap on 1.5GB. This is not exactly 20%.
bydarkweaver87, August 5, 2013
bydarkweaver87, January 15, 2012
Hi,
Just a small path to make it work with a french environment (colon instead of dot in floating numbers) and bonded machines:
# diff -uw /usr/lib/nagios/plugins/check_memcached check_memcached
--- /usr/lib/nagios/plugins/check_memcached 2012-01-16 11:47:41.000000000 +0100
+++ check_memcached 2012-01-16 11:50:58.000000000 +0100
@@ -6,6 +6,12 @@
# Not sure if this script will run on CSH, KSH or other shells
# Anyone who makes it work on those, please let me know.
# Bento Loewenstein
+DOT=true
+
+printf '%f' 0 | grep ',' > /dev/null
+if [ "$?" -eq "0" ] ; then
+ DOT=false
+fi
STATE_OK=0
STATE_WARNING=1
@@ -61,8 +67,12 @@
else
__DISPR=`echo "$__RATE+0.5"|bc -l`
fi
+ if $DOT; then
printf " %1.0f%%|rate=%1.12g" "$__DISPR" "$__RATE"
else
+ printf " %1.0f%%|rate=%1.12g" "`echo $__DISPR | sed -e 's/\./,/g'`" "`echo $__RATE | sed -e 's/\./,/g'`"
+ fi
+ else
printf " No rate"
fi
}
@@ -118,7 +128,7 @@
if [ -z "$HSFLAG" ]
then
- HOST=$(/sbin/ifconfig | grep -A1 eth0 | grep inet | sed -e 's/.* addr:\([^ ]\+\) .*/\1/')
+ HOST=$(/sbin/ip addr | grep global | head -n 1 | sed -r 's/.* (.*)\/[0-9]+ .*/\1/g')
fi
case $OPER in
By the way, thanks for your good job !
RĂ©mi
Just a small path to make it work with a french environment (colon instead of dot in floating numbers) and bonded machines:
# diff -uw /usr/lib/nagios/plugins/check_memcached check_memcached
--- /usr/lib/nagios/plugins/check_memcached 2012-01-16 11:47:41.000000000 +0100
+++ check_memcached 2012-01-16 11:50:58.000000000 +0100
@@ -6,6 +6,12 @@
# Not sure if this script will run on CSH, KSH or other shells
# Anyone who makes it work on those, please let me know.
# Bento Loewenstein
+DOT=true
+
+printf '%f' 0 | grep ',' > /dev/null
+if [ "$?" -eq "0" ] ; then
+ DOT=false
+fi
STATE_OK=0
STATE_WARNING=1
@@ -61,8 +67,12 @@
else
__DISPR=`echo "$__RATE+0.5"|bc -l`
fi
+ if $DOT; then
printf " %1.0f%%|rate=%1.12g" "$__DISPR" "$__RATE"
else
+ printf " %1.0f%%|rate=%1.12g" "`echo $__DISPR | sed -e 's/\./,/g'`" "`echo $__RATE | sed -e 's/\./,/g'`"
+ fi
+ else
printf " No rate"
fi
}
@@ -118,7 +128,7 @@
if [ -z "$HSFLAG" ]
then
- HOST=$(/sbin/ifconfig | grep -A1 eth0 | grep inet | sed -e 's/.* addr:\([^ ]\+\) .*/\1/')
+ HOST=$(/sbin/ip addr | grep global | head -n 1 | sed -r 's/.* (.*)\/[0-9]+ .*/\1/g')
fi
case $OPER in
By the way, thanks for your good job !
RĂ©mi