2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/printer/dell_5310n_health_

23 lines
612 B
Bash
Executable File

#!/bin/bash
#
# dell_5310n_health_ munin grabber script
# 2008.07 by steve@kosada.com
destination=`basename $0 | sed 's/^dell_5310n_health_//g'`
tmpWeb=/tmp/`basename $0`
wget -q -O $tmpWeb http://$destination/cgi-bin/dynamic/PrinterStatus.html
if [ "$1" = "config" ]; then
echo "graph_title dell 5310n health: $destination"
echo 'graph_vlabel count'
echo 'graph_args --lower-limit 0'
echo 'graph_category printing'
echo "toner.label Toner (percent)"
else
echo toner.value `grep '>Black\ Toner' $tmpWeb | perl -p -e 's/^.+>Black\ Toner[^0-9]+([0-9]+)\%<.+$/$1/'`
fi
rm $tmpWeb