diff --git a/gestion/hptools.py b/gestion/hptools.py index abb67e5c..a7399384 100755 --- a/gestion/hptools.py +++ b/gestion/hptools.py @@ -414,6 +414,24 @@ class sw_chbre(hpswitch) : if nom != self.nom() : self.nom(nom) +class sw_prise(sw_chbre): + def __init__(self, prise): + bat = prise[0].lower() + prise = prise[1:] + self.prise_brute = prise + self.switch = 'bat%s-%i.adm.crans.org' % (bat , int(prise[0])) + if prise[-1] == '-' : + #Prise en 10 + self.prise = int(prise[1:-1]) + self.prise10Mb = True + else : + self.prise = int(prise[1:]) + self.prise10Mb = False + + # Config snmp + self.get, self.set, self.walk = config_snmp_secrete(snmp,self.switch) + + if __name__ == '__main__' : import sys, getopt, sre