2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/other/varnish_healthy_backends

29 lines
895 B
Text
Raw Normal View History

2011-09-12 17:38:30 +02:00
#!/bin/sh
#Plugin to monitor the number of healthy and sick backends
#
#
ADMINSERVER=127.0.0.1
ADMINPORT=2000
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Number of Healthy Backends'
echo 'graph_vlabel number of backends'
echo 'graph_category varnish'
echo 'graph_info This graph shows the number of healthy backends in the system.'
echo 'healthy.label Healthy'
echo 'healthy.warning 2:'
echo 'healthy.critical 1:'
echo 'sick.label Sick'
exit 0
fi
healthyServers=`varnishadm -T ${ADMINSERVER}:${ADMINPORT} debug.health 2>&1 | grep 'is Healthy' | wc -l`
sickServers=`varnishadm -T ${ADMINSERVER}:${ADMINPORT} debug.health 2>&1 | grep 'is sick' | wc -l`
echo "healthy.value ${healthyServers}"
echo "sick.value ${sickServers}"