Creation who2b.py
darcs-hash:20071212140204-ddb99-fbd8cf41612769c840584eac6474ca2ebb463c9e.gz
This commit is contained in:
parent
2ee28be80a
commit
99dfb0fccb
1 changed files with 22 additions and 0 deletions
22
gestion/tools/who2b.py
Executable file
22
gestion/tools/who2b.py
Executable file
|
@ -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()
|
Loading…
Add table
Add a link
Reference in a new issue