env.sensor1 Kitchen
env.sensor7 Outside
+ Warning/critical values for all sensors:
+ env.warning 10
+ env.critical 5
+
+ Warning/critical values for single sensors:
+ env.sensor7_warning 40
+ env.sensor7_critical 50
+
+=head1 AUTHOR
+
+Christian Weiske <cweiske@cweiske.de>
+
+=head1 LICENSE
+
+AGPL
+http://www.gnu.org/licenses/agpl.html
+
=head1 MAGIC MARKERS
#%# family=manual
#%# capabilities=autoconf suggest
-=head1 AUTHOR and LICENSE
-
-License: http://www.gnu.org/licenses/agpl.html AGPL
-Author: Christian Weiske <cweiske@cweiske.de>
-
=cut
+. "$MUNIN_LIBDIR/plugins/plugin.sh"
+
TYPE=`basename $0 | sed 's/^.*_//g'`
if [ "$1" = "autoconf" ]; then
code="sensor$i=\${sensor$i:=Sensor $i}"
eval $code
done
-# FIXME: Warning/critical values
if [ "$1" = "config" ]; then
echo 'graph_scale no'
echo 'graph_category sensors'
- #FIXME: warning/critical values
for i in $sensors; do
eval "name=\$sensor$i"
echo "sensor$i.label $name"
+ print_warning "sensor$i"
+ print_critical "sensor$i"
done
exit 0
#split by semicolons
OLDIFS="$IFS"
IFS=";"
-read -r startzeichen zustand zeitstempel\
+read -r sign state timestamp\
t0 t1 t2 t3 t4 t5 t6 t7\
h0 h1 h2 h3 h4 h5 h6 h7\
tc hc ws ns rain checksum\
< "$logfile"
IFS=$OLDIFS
-if [ "$startzeichen" != '$1' ]; then
+if [ "$sign" != '$1' ]; then
echo Log line does not begin with \$1
exit 2
fi
-#FIXME: check timestamp
+curdate=`date +%s`
+if [ "$timestamp" -lt `expr $curdate - 600` ]; then
+ #timestamp is too old, data are too old
+ exit
+fi
if [ "$TYPE" = "temperature" ]; then