scripts/gestion/locate-mac.py
bernat 21303069f6 On gere le cas ou l'on ne trouve pas l'adresse MAC
darcs-hash:20041005162017-d1718-8bf80485fb016344e7c1d7c73c56f595c0d98218.gz
2004-10-05 18:20:17 +02:00

14 lines
416 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():
prise = hpswitch(switch).where_is_mac(argv[1])
if prise != None:
print "%-10s: %d" % (switch, prise)
else:
print "%-10s: non trouvé" % switch