22 lines
536 B
Python
Executable file
22 lines
536 B
Python
Executable file
#! /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()
|