2009-01-20 02:38:37 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# toshiba_5520c_scan_ munin grabber script
|
|
|
|
# 2009.01 by steve@kosada.com
|
|
|
|
|
|
|
|
destination=`basename $0 | sed 's/^toshiba_5520c_scan_//g'`
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
echo "graph_title Toshiba 5520C: Pages Scanned"
|
|
|
|
echo 'graph_vlabel Pages'
|
|
|
|
echo 'graph_args --lower-limit 0'
|
2017-02-22 16:22:46 +01:00
|
|
|
echo 'graph_category printing'
|
2009-01-20 02:38:37 +01:00
|
|
|
|
|
|
|
echo "scanFullColor.label Full Color"
|
|
|
|
echo "scanFullColor.draw AREA"
|
|
|
|
|
|
|
|
echo "scanTwinColor.label Twin Color"
|
|
|
|
echo "scanTwinColor.draw STACK"
|
|
|
|
|
|
|
|
echo "scanBlack.label Black"
|
|
|
|
echo "scanBlack.draw STACK"
|
|
|
|
else
|
|
|
|
infopage=`wget -q -O - http://$destination:8080/TopAccess/Counter/TotalCount/List.htm | dos2unix | perl -p -e 's/\n/ /m'`
|
|
|
|
|
|
|
|
echo scanFullColor.value `echo $infopage | perl -p -e 's/^.+\<B\>Scan Counter\<\/B\>.+?\{Full\ Color[^}]+\,([0-9]+)\}.+$/$1/'`
|
|
|
|
echo scanTwinColor.value `echo $infopage | perl -p -e 's/^.+\<B\>Scan Counter\<\/B\>.+?\{Twin\ Color[^}]+\,([0-9]+)\}.+$/$1/'`
|
|
|
|
echo scanBlack.value `echo $infopage | perl -p -e 's/^.+\<B\>Scan Counter\<\/B\>.+?\{Black[^}]+\,([0-9]+)\}.+$/$1/'`
|
|
|
|
fi
|