diff --git a/gestion/hptools.py b/gestion/hptools.py index f769bc20..17a4a22a 100644 --- a/gestion/hptools.py +++ b/gestion/hptools.py @@ -135,9 +135,12 @@ class snmp : else : raise ValueError('Version incorrecte') - def get_mac(self): - s, r = getstatusoutput("arp -a %s | perl -nle '{print $& if /00(:[0-9a-f]{2}){5}/}'" % self.host) - return r + def getBaseMac(self): + ''' retourne la Base Mac du switch concerné. C'est elle qui est + utilisée pour l'engineid.''' + switch = cl.search("host=%s" % self.host)["machineCrans"][0] + baseMac = switch.mac().replace(':', '')[0:11] + '0' + return baseMac def fetch_engineid(self): self._engineid = '0000000b000%s0' % self.get_mac().replace(':', '')