1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

fping_ => Added informations and fixed a bug

This commit is contained in:
tomav 2013-08-20 22:48:47 +02:00
parent 12d632ca62
commit 29be1c0078

View file

@ -1,41 +1,50 @@
#!/bin/sh #!/bin/sh
# #
# Plugin to monitor a server/network availability. # Description : Plugin to monitor a server/network availability.
# Author: Thomas VIAL # Author : Thomas VIAL
# # Usage : ln -s /path/to/fping_ /etc/munin/fping_www.google.com
# Requirements: # Explaination : Will graph connection to www.google.com
# Requirements :
# * fping # * fping
# #
target=`basename $0 | sed 's/^fping_//g'` target=`basename $0 | sed 's/^fping_//g'`
#target='dev.instalbu.ms' item=`echo $target | sed -e 's/\.//g'`
#target='127.0.0.1'
#
# Config
#
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then
echo "graph_title ${target} availability" echo "graph_title ${target} availability"
echo "graph_args --upper-limit 100" echo "graph_args -l 0 -u 100"
echo "graph_vlabel Availability" echo "graph_vlabel Availability"
echo "graph_category network" echo "graph_category network"
echo "graph_info Displays Network Availability"
# Success # Success
echo "fping_${target}_success.label Reachable" echo "fping_${item}_success.label Reachable"
echo "fping_${target}_success.type GAUGE" #echo "fping_${item}_success.type GAUGE"
echo "fping_${target}_success.color 00CC00CC" echo "fping_${item}_success.colour 00CC00CC"
# Failure # Failure
echo "fping_${target}_failure.label Unreachable" echo "fping_${item}_failure.label Unreachable"
echo "fping_${target}_failure.type AREA" echo "fping_${item}_failure.type AREA"
echo "fping_${target}_failure.color ff0000" echo "fping_${item}_failure.colour ff0000"
exit 0 exit 0
fi fi
#
# Let's go!
#
fping -q $target fping -q $target
status=$? status=$?
if [ $status -eq 0 ]; then if [ $status -eq 0 ]; then
echo "fping_${target}_success.value 100" # Success
echo "fping_${target}_failure.value 0" echo "fping_${item}_success.value 100"
echo "fping_${item}_failure.value 0"
else else
echo "fping_${target}_success.value 0" # Failure
echo "fping_${target}_failure.value 100" echo "fping_${item}_success.value 0"
echo "fping_${item}_failure.value 100"
fi fi