$ cd ..
-Running the munin plugin is also relatively easy, and you can easily pass
-the environment configuration variables from the munin configuration
-on the cli:
-$ logfile=test.log sensors="0 1 7" ./munin/usb-wde1_temperature
+Running the munin plugin for development purposes is also relatively easy
+since you can pass the environment configuration variables
+from the munin configuration on the command line:
+$ MUNIN_LIBDIR=/usr/share/munin/ logfile=test.log sensors="0 1 7" ./munin/usb-wde1_temperature
env.sensor1 Kitchen
env.sensor7 Outside
-=head1 MAGIC MARKERS
+ Warning/critical values for all sensors:
+ env.warning 10
+ env.critical 5
- #%# family=manual
- #%# capabilities=autoconf suggest
+ Warning/critical values for single sensors:
+ env.sensor7_warning 40
+ env.sensor7_critical 50
=head1 AUTHOR
AGPL
http://www.gnu.org/licenses/agpl.html
+=head1 MAGIC MARKERS
+
+ #%# family=manual
+ #%# capabilities=autoconf suggest
+
=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