From ce7a4cc4c762a529644ee429555cc34382c594bc Mon Sep 17 00:00:00 2001 From: glondu Date: Fri, 23 Feb 2007 23:20:52 +0100 Subject: [PATCH] Acrobatie pour ignorer le dcompte des pages restantes. darcs-hash:20070223222052-68412-2969da806d5c774821355f3dc856f17ca39412c1.gz --- munin/etat_imprimante | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/munin/etat_imprimante b/munin/etat_imprimante index f6e2bdee..77319376 100755 --- a/munin/etat_imprimante +++ b/munin/etat_imprimante @@ -23,6 +23,7 @@ dico = { "JAUNE": 0, "NOIR": 0, 'COMM TAMB. NOIR': 0, + 'PAGES REST.': 0, "": 0, } @@ -33,7 +34,15 @@ def etat(): try: comm = hptools.snmp(host="laserjet.adm.crans.org", version="1", community="public") for oid in liste_oid: - total += dico.get(comm.get_string(oid), 4) + msg = comm.get_string(oid) + diff = dico.get(msg, None) + if diff == None: + for k in dico.keys(): + if k in msg and k != "": diff = dico[k] + if diff == None: + diff = 4 + total += diff + except Exception, err: total += 24 return total