[impression/etat_imprimante] on récupère les erreurs
Ignore-this: bf6a4fe45c27c277e41339ae7832f62e darcs-hash:20090526122337-bd074-139ca0919ddda2fec79dcc7e938f56a0bba7c525.gz
This commit is contained in:
parent
945c02bd73
commit
7da73d50e6
1 changed files with 13 additions and 10 deletions
|
@ -30,22 +30,25 @@ def etat_canon():
|
||||||
'other(1)\ndown(5)' : u"Imprimante hors-service",
|
'other(1)\ndown(5)' : u"Imprimante hors-service",
|
||||||
'other(1)\nrunning(2)' : u'Imprimante en veille',
|
'other(1)\nrunning(2)' : u'Imprimante en veille',
|
||||||
'warmup(5)\nrunning(2)' : u'Préchauffage',
|
'warmup(5)\nrunning(2)' : u'Préchauffage',
|
||||||
'idle(3)\nwarning(3)' : u"""Imprimante fonctionnelle
|
'idle(3)\nwarning(3)' : u'Imprimante fonctionnelle',
|
||||||
(penser à vérifier le niveau d'encre et de papier)""",
|
'printing(4)\nwarning(3)' : u'Impression en cours'
|
||||||
'printing(4)\nwarning(3)' : u"""Impression en cours
|
|
||||||
(penser à vérifier le niveau d'encre et de papier)""",
|
|
||||||
}
|
}
|
||||||
try:
|
try:
|
||||||
msg = liste_msg = []
|
raw_msg = msg = []
|
||||||
comm = snmp(host="imprimante.adm.crans.org", version="1", community="public")
|
comm = snmp(host="imprimante.adm.crans.org", version="1", community="public")
|
||||||
|
|
||||||
for oid in [".hrPrinterStatus.1", ".hrDeviceStatus.1"]:
|
for oid in [".hrPrinterStatus.1", ".hrDeviceStatus.1"]:
|
||||||
#".hrPrinterDetectedErrorState.1"
|
#".hrPrinterDetectedErrorState.1"
|
||||||
msg.append(comm.get_string(oid))
|
raw_msg.append(comm.get_string(oid))
|
||||||
liste_msg = _dico['\n'.join(msg)].split('\n')
|
msg = _dico['\n'.join(msg)].split('\n')
|
||||||
except Exception,err:
|
|
||||||
liste_msg.append("[%s]" % unicode(err))
|
|
||||||
|
|
||||||
return liste_msg
|
if raw_msg[1] == 'warning(3)':
|
||||||
|
msg += (comm.walk('mib-2.43.18.1.1.8').values()
|
||||||
|
|
||||||
|
except Exception,err:
|
||||||
|
msg.append("[%s]" % unicode(err))
|
||||||
|
|
||||||
|
return msg
|
||||||
|
|
||||||
def etat_laserjet():
|
def etat_laserjet():
|
||||||
""" Renvoie une liste des differents ecrans actuels du display de l'imprimante """
|
""" Renvoie une liste des differents ecrans actuels du display de l'imprimante """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue