mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
73 lines
1.6 KiB
Bash
Executable File
73 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Script to monitor Munin-update
|
|
#
|
|
# Parameters understood:
|
|
#
|
|
# config (required)
|
|
# autoconf (optional - used by munin-config)
|
|
#
|
|
# $Log$
|
|
# Revision 1.3 2004/12/09 18:39:01 jimmyo
|
|
# Added more sensible autoconf to generic/munin_graph,munin_update,sybase_space.
|
|
#
|
|
# Revision 1.2 2004/01/29 19:39:00 jimmyo
|
|
# Generic plugins now use printf instead of echo -n, as this is more portable (SF#885564)
|
|
#
|
|
# Revision 1.1 2004/01/02 18:50:00 jimmyo
|
|
# Renamed occurrences of lrrd -> munin
|
|
#
|
|
# Revision 1.1.1.1 2004/01/02 15:18:07 jimmyo
|
|
# Import of LRRD CVS tree after renaming to Munin
|
|
#
|
|
# Revision 1.6 2003/11/10 18:13:46 jimmyo
|
|
# Revert changes done in 1.5
|
|
#
|
|
# Revision 1.5 2003/11/07 17:43:16 jimmyo
|
|
# Cleanups and log entries
|
|
#
|
|
#
|
|
#
|
|
# Magic markers (optional - used by munin-config and installation
|
|
# scripts):
|
|
#
|
|
#%# family=manual
|
|
#%# capabilities=autoconf
|
|
|
|
if [ ! "$UPDATE_STATSFILE" ]; then
|
|
UPDATE_STATSFILE=/var/lib/munin/munin-update.stats
|
|
fi
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
|
if [ -f $UPDATE_STATSFILE ]; then
|
|
echo "yes"
|
|
else
|
|
echo "no (logfile not readable)"
|
|
fi
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
echo 'graph_title Munin-update'
|
|
echo 'graph_category munin'
|
|
echo 'graph_vlabel seconds'
|
|
[ -f $UPDATE_STATSFILE ] || exit 0
|
|
cat $UPDATE_STATSFILE | grep "UD" | while read i; do
|
|
name=`echo $i | cut -d"|" -f2 |tr '.-' '__'`
|
|
printf "$name.label "
|
|
echo $i | cut -d"|" -f2
|
|
echo "$name.warning 100"
|
|
echo "$name.critical 180"
|
|
done
|
|
exit 0
|
|
fi
|
|
|
|
[ -f $UPDATE_STATSFILE ] || exit 0
|
|
|
|
cat $UPDATE_STATSFILE | grep "UD" | while read i; do
|
|
name=`echo $i | cut -d"|" -f2 | tr '.-' '__'`
|
|
printf "$name.value "
|
|
echo $i | cut -d"|" -f3
|
|
done
|