Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
@darkweaver87
Favorites0
Views1285
Projects1
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
Reviewed 14 years ago
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%.
Reviewed 12 years ago
On debian wheezy with an SL4540 I had to comment the HP Smart Array presence check in order to make it working. Otherwize I've got "RAID UNKNOWN - HP Smart Array not found". I think it's because the system recognize it has an internal drive, so you may add an option to enable/disable the check.