Plugin munin pour afficher le nombre de pages restantes de certains
consommables darcs-hash:20060928085752-9e428-3f6bbe18052c1e426fe446bf19d58429dc7f3620.gz
This commit is contained in:
parent
381a154a8a
commit
c080a8663a
1 changed files with 37 additions and 0 deletions
37
munin/imprimante
Executable file
37
munin/imprimante
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*
|
||||
|
||||
import sys
|
||||
sys.path.append("/usr/scripts/gestion")
|
||||
|
||||
import hptools
|
||||
|
||||
try :
|
||||
arg = sys.argv[1]
|
||||
except :
|
||||
arg = ''
|
||||
|
||||
if arg == "config" :
|
||||
print 'host_name Imprimante'
|
||||
print 'graph_title État fournitures'
|
||||
print "graph_args --base 30000 --lower-limit 0"
|
||||
print "graph_vlabel nb de pages restantes"
|
||||
print "car_cya.label Cartouche cyan"
|
||||
print "car_cya.draw LINE2"
|
||||
print "kit_net.label Kit de nettoyage image"
|
||||
print "kit_net.draw LINE2"
|
||||
else:
|
||||
try:
|
||||
comm = hptools.snmp(host="laserjet.adm.crans.org",version="1",community="public")
|
||||
except Exception,err:
|
||||
exit
|
||||
dico_oid = {'car_cya' : "enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.2.0",
|
||||
'kit_net' : "enterprises.11.2.3.9.4.2.1.4.1.10.5.1.1.10.0"}
|
||||
|
||||
for fieldname in dico_oid.keys():
|
||||
try:
|
||||
value = comm.get(dico_oid[fieldname])
|
||||
except Exception,err:
|
||||
value = 0
|
||||
|
||||
print "%s.value %s" % (fieldname,value)
|
Loading…
Add table
Add a link
Reference in a new issue