Build precise queries to find exactly what you need
Press ESC to close
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
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!