예제 #1
0
    def collectData(self, equipment, proxy):
        proxy.use_getbulk = False # Some Blade have bogus GETBULK
        ports = PortCollector(equipment, proxy, normPort=lambda x: x%128)
        if self.ifDescr is not None:
            ports.ifDescr = self.ifDescr

        speed = AlteonSpeedCollector(equipment, proxy, lambda x: x%128)
        speed.oidDuplex = '%s.1.3.2.1.1.3' % self.baseoid
        speed.oidSpeed = '%s.1.3.2.1.1.2' % self.baseoid
        speed.oidAutoneg = '%s.1.1.2.2.1.11'% self.baseoid

        fdb = FdbCollector(equipment, proxy, self.config, normport=lambda x: x%128)
        arp = ArpCollector(equipment, proxy, self.config)
        lldp = LldpCollector(equipment, proxy, normport=lambda x: x%128)

        vlan = AlteonVlanCollector(equipment, proxy, lambda x: x%128 - 1)
        vlan.oidVlanNames = '%s.2.1.1.3.1.2' % self.baseoid
        vlan.oidVlanPorts = '%s.2.1.1.3.1.3' % self.baseoid

        d = ports.collectData()
        d.addCallback(lambda x: speed.collectData())
        d.addCallback(lambda x: fdb.collectData())
        d.addCallback(lambda x: arp.collectData())
        d.addCallback(lambda x: vlan.collectData())
        d.addCallback(lambda x: lldp.collectData())
        return d
예제 #2
0
 def collectData(self, equipment, proxy):
     # On Cisco, ifName is more revelant than ifDescr, especially
     # on Catalyst switches. This is absolutely not the case for a CSS.
     t = {}
     trunk = CiscoTrunkCollector(equipment, proxy, t)
     if self.css:
         ports = PortCollector(equipment, proxy, trunk=t)
     else:
         ports = PortCollector(equipment,
                               proxy,
                               trunk=t,
                               names="ifDescr",
                               descrs="ifName")
         ports.ifDescr = ports.ifAlias
     fdb = CiscoFdbCollector(equipment, proxy, self.config)
     arp = ArpCollector(equipment, proxy, self.config)
     cdp = CdpCollector(equipment, proxy)
     lldp = LldpCollector(equipment, proxy)
     vlan = CiscoVlanCollector(equipment, proxy, ports)
     d = trunk.collectData()
     d.addCallback(lambda x: ports.collectData())
     d.addCallback(lambda x: arp.collectData())
     d.addCallback(lambda x: fdb.collectData())
     d.addCallback(lambda x: cdp.collectData())
     d.addCallback(lambda x: lldp.collectData())
     d.addCallback(lambda x: vlan.collectData())
     return d
예제 #3
0
    def collectData(self, equipment, proxy):
        proxy.use_getbulk = False  # Some Blade have bogus GETBULK
        ports = PortCollector(equipment, proxy, normPort=lambda x: x % 128)
        if self.ifDescr is not None:
            ports.ifDescr = self.ifDescr

        speed = AlteonSpeedCollector(equipment, proxy, lambda x: x % 128)
        speed.oidDuplex = '%s.1.3.2.1.1.3' % self.baseoid
        speed.oidSpeed = '%s.1.3.2.1.1.2' % self.baseoid
        speed.oidAutoneg = '%s.1.1.2.2.1.11' % self.baseoid

        fdb = FdbCollector(equipment,
                           proxy,
                           self.config,
                           normport=lambda x: x % 128)
        arp = ArpCollector(equipment, proxy, self.config)
        lldp = LldpCollector(equipment, proxy, normport=lambda x: x % 128)

        vlan = AlteonVlanCollector(equipment, proxy, lambda x: x % 128 - 1)
        vlan.oidVlanNames = '%s.2.1.1.3.1.2' % self.baseoid
        vlan.oidVlanPorts = '%s.2.1.1.3.1.3' % self.baseoid

        d = ports.collectData()
        d.addCallback(lambda x: speed.collectData())
        d.addCallback(lambda x: fdb.collectData())
        d.addCallback(lambda x: arp.collectData())
        d.addCallback(lambda x: vlan.collectData())
        d.addCallback(lambda x: lldp.collectData())
        return d
예제 #4
0
 def collectData(self, equipment, proxy):
     ports = PortCollector(equipment, proxy, self.normPortName)
     ports.ifName = ports.ifDescr
     ports.ifDescr = '.1.3.6.1.2.1.2.2.1.1' # ifIndex
     speed = AlteonSpeedCollector(equipment, proxy, lambda x: x+256)
     fdb = FdbCollector(equipment, proxy, self.config)
     arp = ArpCollector(equipment, proxy, self.config)
     vlan = AlteonVlanCollector(equipment, proxy, lambda x: self.normPortIndex(x-1))
     sonmp = SonmpCollector(equipment, proxy, self.normPortIndex)
     d = ports.collectData()
     d.addCallback(lambda x: speed.collectData())
     d.addCallback(lambda x: fdb.collectData())
     d.addCallback(lambda x: arp.collectData())
     d.addCallback(lambda x: vlan.collectData())
     d.addCallback(lambda x: sonmp.collectData())
     return d
예제 #5
0
 def collectData(self, equipment, proxy):
     ports = PortCollector(equipment, proxy, self.normPortName)
     ports.ifName = ports.ifDescr
     ports.ifDescr = '.1.3.6.1.2.1.2.2.1.1'  # ifIndex
     speed = AlteonSpeedCollector(equipment, proxy, lambda x: x + 256)
     fdb = FdbCollector(equipment, proxy, self.config)
     arp = ArpCollector(equipment, proxy, self.config)
     vlan = AlteonVlanCollector(equipment, proxy,
                                lambda x: self.normPortIndex(x - 1))
     sonmp = SonmpCollector(equipment, proxy, self.normPortIndex)
     d = ports.collectData()
     d.addCallback(lambda x: speed.collectData())
     d.addCallback(lambda x: fdb.collectData())
     d.addCallback(lambda x: arp.collectData())
     d.addCallback(lambda x: vlan.collectData())
     d.addCallback(lambda x: sonmp.collectData())
     return d
예제 #6
0
파일: passport.py 프로젝트: xakraz/wiremaps
 def collectData(self, equipment, proxy):
     ports = PortCollector(equipment, proxy)
     ports.ifDescr = ports.ifName
     ports.ifName = ".1.3.6.1.4.1.2272.1.4.10.1.1.35"
     speed = NortelSpeedCollector(equipment, proxy)
     mlt = MltCollector(proxy)
     fdb = PassportFdbCollector(equipment, proxy, self.config, mlt)
     arp = ArpCollector(equipment, proxy, self.config)
     sonmp = SonmpCollector(equipment, proxy, lambda x: x + 63)
     vlan = NortelVlanCollector(equipment, proxy, lambda x: x - 1)
     d = ports.collectData()
     d.addCallback(lambda x: speed.collectData())
     d.addCallback(lambda x: mlt.collectData())
     d.addCallback(lambda x: fdb.collectData())
     d.addCallback(lambda x: arp.collectData())
     d.addCallback(lambda x: sonmp.collectData())
     d.addCallback(lambda x: vlan.collectData())
     return d
예제 #7
0
 def collectData(self, equipment, proxy):
     ports = PortCollector(equipment, proxy)
     ports.ifDescr = ports.ifName
     ports.ifName = ".1.3.6.1.4.1.2272.1.4.10.1.1.35"
     speed = NortelSpeedCollector(equipment, proxy)
     mlt = MltCollector(proxy)
     fdb = PassportFdbCollector(equipment, proxy, self.config, mlt)
     arp = ArpCollector(equipment, proxy, self.config)
     sonmp = SonmpCollector(equipment, proxy, lambda x: x+63)
     vlan = NortelVlanCollector(equipment, proxy, lambda x: x-1)
     d = ports.collectData()
     d.addCallback(lambda x: speed.collectData())
     d.addCallback(lambda x: mlt.collectData())
     d.addCallback(lambda x: fdb.collectData())
     d.addCallback(lambda x: arp.collectData())
     d.addCallback(lambda x: sonmp.collectData())
     d.addCallback(lambda x: vlan.collectData())
     return d
예제 #8
0
 def collectData(self, equipment, proxy):
     # On Cisco, ifName is more revelant than ifDescr, especially
     # on Catalyst switches. This is absolutely not the case for a CSS.
     t = {}
     trunk = CiscoTrunkCollector(equipment, proxy, t)
     if self.css:
         ports = PortCollector(equipment, proxy, trunk=t)
     else:
         ports = PortCollector(equipment, proxy, trunk=t,
                               names="ifDescr", descrs="ifName")
         ports.ifDescr = ports.ifAlias
     fdb = CiscoFdbCollector(equipment, proxy, self.config)
     arp = ArpCollector(equipment, proxy, self.config)
     cdp = CdpCollector(equipment, proxy)
     vlan = CiscoVlanCollector(equipment, proxy, ports)
     d = trunk.collectData()
     d.addCallback(lambda x: ports.collectData())
     d.addCallback(lambda x: arp.collectData())
     d.addCallback(lambda x: fdb.collectData())
     d.addCallback(lambda x: cdp.collectData())
     d.addCallback(lambda x: vlan.collectData())
     return d