2011-02-18 16:40:34 +01:00
|
|
|
#!/bin/sh
|
|
|
|
# http://exchange.munin-monitoring.org/plugins/alertme_power/details
|
|
|
|
#
|
|
|
|
# alertme_power relies on http://code.google.com/p/alertmepi/
|
|
|
|
# to have been installed and working
|
|
|
|
#
|
2018-08-02 02:03:42 +02:00
|
|
|
# 20110120 - update to use correct mixed case for AlertMe and remove cruft
|
2011-02-18 16:40:34 +01:00
|
|
|
# left over from creating this plugin from another script
|
|
|
|
#
|
|
|
|
# add to the plugins-conf.d/munin so that it can read the /etc/alertme files
|
|
|
|
# [alertme_*]
|
|
|
|
# user root
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = "config" ] ; then
|
|
|
|
echo "graph_title AlertMe Keyfobs At Home"
|
2014-09-06 22:28:53 +02:00
|
|
|
echo "graph_category sensors"
|
2011-02-18 16:40:34 +01:00
|
|
|
echo "graph_info this graph shows AlertMe Keyfob present count"
|
|
|
|
echo "graph_vlabel number"
|
|
|
|
echo "KeyfobsAtHome.label number of keyfobs present"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo -n "KeyfobsAtHome.value "
|
|
|
|
KFC=`/usr/local/bin/alertmepi.pl -k | wc -l`
|
|
|
|
|
|
|
|
if [ $? -eq 0 ] ; then
|
2018-08-02 02:03:42 +02:00
|
|
|
echo $KFC
|
2011-02-18 16:40:34 +01:00
|
|
|
else
|
|
|
|
echo U
|
|
|
|
fi
|
|
|
|
|
|
|
|
# end alertme_power munin_plugin
|