diff --git a/impression/printer_watch.py b/impression/printer_watch.py index 5938ad2e..dc45ba0b 100755 --- a/impression/printer_watch.py +++ b/impression/printer_watch.py @@ -24,7 +24,7 @@ except (IOError, ValueError, TypeError): status_id = netsnmp.Varbind("hrDeviceStatus.1") status = netsnmp.snmpget(status_id, Version=1, DestHost="imprimante.adm", Community="public") -if status == ('5',) and (not successfuly_imported or successfuly_imported and last_status == '2'): +if status == ('5',) and (not successfuly_imported or successfuly_imported and (last_status == '2' or last_status == '3')): """ Cas 1: L'imprimante est down et soit elle était précédemment fonctionnelle ou son statut précédent est inconnu. On envoie un mail pour signaler qu'elle est down. @@ -44,7 +44,7 @@ if status == ('5',) and (not successfuly_imported or successfuly_imported and la sendmail.sendmail(u"imprimante.adm@crans.org", u"impression@lists.crans.org", u"Imprimante hors service", msg, more_headers={"X-Mailer": "/usr/scripts/impression/printer_watch.py", "Message-ID": message_id}) -elif status == ('2',) and successfuly_imported and last_status == '5': +elif (status == ('2',) or status == ('3',)) and successfuly_imported and last_status == '5': """ Cas 2: L'imprimante est fonctionnelle après une panne. On envoi un mail pour signaler que ce n'est plus la peine de se déplacer.