root / plugins / printer / dell_5310n_health_ @ d112f623
Historique | Voir | Annoter | Télécharger (611 octets)
| 1 |
#!/bin/bash |
|---|---|
| 2 |
# |
| 3 |
# dell_5310n_health_ munin grabber script |
| 4 |
# 2008.07 by steve@kosada.com |
| 5 |
|
| 6 |
destination=`basename $0 | sed 's/^dell_5310n_health_//g'` |
| 7 |
|
| 8 |
tmpWeb=/tmp/`basename $0` |
| 9 |
wget -q -O $tmpWeb http://$destination/cgi-bin/dynamic/PrinterStatus.html |
| 10 |
|
| 11 |
if [ "$1" = "config" ]; then |
| 12 |
echo "graph_title dell 5310n health: $destination" |
| 13 |
echo 'graph_vlabel count' |
| 14 |
echo 'graph_args --lower-limit 0' |
| 15 |
echo 'graph_category printer' |
| 16 |
|
| 17 |
echo "toner.label Toner (percent)" |
| 18 |
else |
| 19 |
echo toner.value `grep '>Black\ Toner' $tmpWeb | perl -p -e 's/^.+>Black\ Toner[^0-9]+([0-9]+)\%<.+$/$1/'` |
| 20 |
fi |
| 21 |
|
| 22 |
rm $tmpWeb |
