scripts/gestion/locate-mac.py
bernat b2de2e117c Donne aussi le nom de la prise
darcs-hash:20041017001547-d1718-889d51ce142fbb3c07cac2c8135718fd62545528.gz
2004-10-17 02:15:47 +02:00

15 lines
454 B
Python
Executable file

#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
# Localise une adresse MAC sur les différents switchs
from annuaires import reverse, all_switchs
from hptools import hpswitch
from sys import argv
for switch in ['backbone'] + all_switchs():
sw = hpswitch(switch)
prise = sw.where_is_mac(argv[1])
if prise != None:
print "%-10s: %d (%s)" % (switch, prise, sw.nom(None, prise))
else:
print "%-10s: non trouvé" % switch