def __init__(self, snmp_object): """Function for intializing the class. Args: snmp_object: SNMP Interact class object from snmp_manager.py Returns: None """ # Define query object self.snmp_object = snmp_object # Get one OID entry in MIB (lldpRemSysName) test_oid = '.1.0.8802.1.1.2.1.4.1.1.9' super().__init__(snmp_object, test_oid, tags=['layer1']) # Load the ifindex baseport map if this mib is supported bridge_mib = BridgeQuery(self.snmp_object) if self.supported() and bridge_mib.supported(): self.baseportifindex = bridge_mib.dot1dbaseport_2_ifindex() else: self.baseportifindex = None
def __init__(self, snmp_object): """Function for intializing the class. Args: snmp_object: SNMP Interact class object from snmp_manager.py Returns: None """ # Define query object self.snmp_object = snmp_object # Get one OID entry in MIB (jnxExVlanTag) test_oid = '.1.3.6.1.4.1.2636.3.40.1.5.1.7.1.3' super().__init__(snmp_object, test_oid, tags=['layer1', 'layer2']) # Get mapping of the VLAN's dot1dbaseport ID value to its jnxExVlanTag # Do this only once instead of every time we invoke a method if self.supported() is True: self.vlan_map = self._vlanid2tag() else: self.vlan_map = None # Get a mapping of dot1dbaseport values to the corresponding ifindex bridge_mib = BridgeQuery(self.snmp_object) self.baseportifindex = bridge_mib.dot1dbaseport_2_ifindex()
def __init__(self, snmp_object): """Function for intializing the class. Args: snmp_object: SNMP Interact class object from snmp_manager.py Returns: None """ # Define query object self.snmp_object = snmp_object # Get one OID entry in MIB (dot1qPvid) test_oid = '.1.3.6.1.2.1.17.7.1.4.5.1.1' super().__init__(snmp_object, test_oid, tags=['layer1']) # Get a mapping of dot1dbaseport values to the corresponding ifindex bridge_mib = BridgeQuery(self.snmp_object) self.baseportifindex = bridge_mib.dot1dbaseport_2_ifindex()