Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / printer / oki_c5500_pages_ @ 942bda31

Historique | Voir | Annoter | Télécharger (917 octets)

1 3c299b3d Steve Mokris
#!/bin/bash
2
#
3
# oki_c5500_pages_ munin grabber script
4
# 2008.03 by steve@kosada.com
5
6
destination=`basename $0 | sed 's/^oki_c5500_pages_//g'`
7
password='foo'
8
9
if [ "$1" = "config" ]; then
10
	echo "graph_title oki c5500 pages: $destination"
11
	echo 'graph_vlabel count'
12
	echo 'graph_args --lower-limit 0'
13
	echo 'graph_category printer'
14
15
	echo "tray1.label Tray 1"
16
	echo "tray2.label Tray 2"
17
	echo "total.label Total"
18
else
19
	infopage=`wget -q -O - http://root:$password@$destination/printer/printerinfo_top.htm | perl -p -e 's/\n/ /m'`
20
21
	echo tray1.value    `echo $infopage | perl -p -e 's/^.+Tray\ 1\ Page\ Count\:\ \<\/TD\>\<TD\ WIDTH\=\"94\"\>([0-9]+)\<.+$/$1/'`
22
	echo tray2.value    `echo $infopage | perl -p -e 's/^.+Tray\ 2\ Page\ Count\:\ \<\/TD\>\<TD\ WIDTH\=\"94\"\>([0-9]+)\<.+$/$1/'`
23
	echo total.value    `echo $infopage | perl -p -e 's/^.+Total\ Page\ Count\:\ \<\/TD\>\<TD\ WIDTH\=\"94\"\>([0-9]+)\<.+$/$1/'`
24
fi