mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-08-02 06:08:23 +00:00
- have some dirs
This commit is contained in:
parent
0b089ea777
commit
08346aac58
687 changed files with 0 additions and 0 deletions
34
plugins/environmental/alertme_keyfobsathome
Executable file
34
plugins/environmental/alertme_keyfobsathome
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/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
|
||||
#
|
||||
# 20110120 - update to use correct mixed case for AlertMe and remove cruft
|
||||
# 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"
|
||||
echo "graph_category environmental"
|
||||
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
|
||||
echo $KFC
|
||||
else
|
||||
echo U
|
||||
fi
|
||||
|
||||
# end alertme_power munin_plugin
|
50
plugins/environmental/alertme_power
Executable file
50
plugins/environmental/alertme_power
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/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
|
||||
#
|
||||
# 20110120 - update to use correct mixed case for AlertMe and remove cruft
|
||||
# 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
|
||||
|
||||
|
||||
TMPFILE=/var/run/munin/alertme_power.dat
|
||||
|
||||
if [ "$1" = "config" ] ; then
|
||||
if [ ! -f $TMPFILE ] ; then
|
||||
# cache hub name and list of devices during config phase to speed up normal run time
|
||||
/usr/local/bin/alertmepi.pl -a > $TMPFILE
|
||||
/usr/local/bin/alertmepi.pl -d | egrep "is the power controller named|is the powerclamp named" >> $TMPFILE
|
||||
fi
|
||||
|
||||
echo "graph_title AlertMe Power"
|
||||
echo "graph_category environmental"
|
||||
echo -n "graph_info this graph shows AlertMe power measurements for "
|
||||
head -1 $TMPFILE
|
||||
echo "graph_vlabel power (W)"
|
||||
|
||||
tail +2 $TMPFILE | (
|
||||
while read DEVICE OTHER
|
||||
do
|
||||
NAME=`echo $OTHER | awk -F\' '{print $2}' | sed -e 's/ /_/g' -e 's/-/_/g'`
|
||||
echo "${NAME}_power.label $NAME "
|
||||
done
|
||||
)
|
||||
|
||||
exit
|
||||
fi
|
||||
|
||||
tail +2 $TMPFILE | (
|
||||
while read DEVICE OTHER
|
||||
do
|
||||
NAME=`echo $OTHER | awk -F\' '{print $2}' | sed -e 's/ /_/g' -e 's/-/_/g'`
|
||||
echo -n "${NAME}_power.value "
|
||||
/usr/local/bin/alertmepi.pl -e $DEVICE | sed -e 's/.* //' -e 's/W.//'
|
||||
done
|
||||
)
|
||||
|
||||
# end alertme_power munin_plugin
|
Loading…
Add table
Add a link
Reference in a new issue