diff --git a/gestion/tools/who2b.py b/gestion/tools/who2b.py new file mode 100755 index 00000000..d095f9f2 --- /dev/null +++ b/gestion/tools/who2b.py @@ -0,0 +1,22 @@ +#! /usr/bin/env python + +import sys + +sys.path.append('/usr/scripts/gestion') +from ldap_crans import crans_ldap +from hptools import hpswitch, ConversationError +from affich_tools import coul, cprint +import whos + +def liste_machines_fixe(): + sw = hpswitch('batb-0') ## Quel switch il faut ? + db = crans_ldap() + try: + macs = sw.show_prise_mac(48): ## Quelle prise il faut ? + except ConversationError: + print coul("Impossible de communiquer avec le switch !") + for mac in macs: + machines = db.search("mac=%s" % mac) + + +liste_machines_fixe()