From 6e1ba6c3ade3f98a29fb7503128c6d721c87f517 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Wed, 12 Sep 2012 08:34:04 +0200 Subject: [PATCH] =?UTF-8?q?[who2b]=20on=20esp=C3=A8re=20y=20trouver=20une?= =?UTF-8?q?=20freebox...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: 4ef1e9b360785d123e47835c26c773f6 darcs-hash:20120912063404-28565-60a21ade821a29557d41e6e002124b0dddcfca46.gz --- gestion/tools/who2b.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gestion/tools/who2b.py b/gestion/tools/who2b.py index 49b93ee5..8c94f969 100644 --- a/gestion/tools/who2b.py +++ b/gestion/tools/who2b.py @@ -26,11 +26,10 @@ def liste_2b(): # (/etc/snmp/snmp.conf) macs = sw.show_prise_mac(33) #B9, ex-(D9->87) - #Les machines sédentaires des nounous, bof - try: - macs.remove('00:09:6b:c0:03:42') #omega.crans.org - except: - pass + # Machines habituellement présentes, s'inquiéter si on ne les voit plus: + expected = { + "00:07:cb:b1:99:4e": "Freebox", + } # Machines branchée sur la prise # (on voit aussi les machines branchées via une borne WiFi du 2B) @@ -51,8 +50,11 @@ def liste_2b(): pass else: machines_crans.append(m) - else: - cprint("Machine inconnue: %s" % mac, 'rouge') + elif mac not in expected: + cprint("Machine inconnue: %s" % mac, 'rouge') + for expectedMac in expected.iterkeys(): + if expectedMac not in macs: + cprint("Machine %s manquante !" % expected[expectedMac], 'rouge') # Affichage des machines cprint('---=== Machines du Crans ===---', 'bleu') aff(machines_crans, mtech=True)