(self)
return res
SNMP Walk

        Returns:
            Dictionary with configurations fetched via SNMP.
SNMP Walk
SNMP Walk
def _walk(self):
        """SNMP Walk

        Returns:
            Dictionary with configurations fetched via SNMP.

        """
        iterator = nextCmd(
            self.engine, CommunityData('public'),
            UdpTransportTarget((self.address, self.port)), ContextData(),
            ObjectType(
                ObjectIdentity(self.mib, '', 0).addMibSource(self.mib_dir)))
        res = {}
        for errorIndication, errorStatus, errorIndex, varBinds in iterator:
            if errorIndication:
                logger.error(errorIndication)
            elif errorStatus:
                logger.error(
                    '%s at %s' %
                    (errorStatus.prettyPrint(),
                     errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
            else:
                for varBind in varBinds:
                    logger.debug(varBind)
                    varBindList = [x.prettyPrint() for x in varBind]
                    key = varBindList[0].replace(self.mib + "::", "")
                    if (len(varBindList) > 2):
                        res[key] = tuple(varBindList[1:])
                    else:
                        res[key] = varBindList[1]
        return res
def _walk ( self ) : iterator = nextCmd ( self . engine , CommunityData ( 'public' ) , UdpTransportTarget ( ( self . address , self . port ) ) , ContextData ( ) , ObjectType ( ObjectIdentity ( self . mib , '' , 0 ) . addMibSource ( self . mib_dir ) ) ) res = { } for errorIndication , errorStatus , errorIndex , varBinds in iterator : if errorIndication : logger . error ( errorIndication ) elif errorStatus : logger . error ( '%s at %s' % ( errorStatus . prettyPrint ( ) , errorIndex and varBinds [ int ( errorIndex ) - 1 ] [ 0 ] or '?' ) ) else : for varBind in varBinds : logger . debug ( varBind ) varBindList = [ x . prettyPrint ( ) for x in varBind ] key = varBindList [ 0 ] . replace ( self . mib + "::" , "" ) if ( len ( varBindList ) > 2 ) : res [ key ] = tuple ( varBindList [ 1 : ] ) else : res [ key ] = varBindList [ 1 ] return res