(self, *variables)
Get one or more variables via SNMP

        Args:
            Tuple with the variables to fetch via SNMP.

        Returns:
            List of tuples with the fetched keys and values.
Get one or more variables via SNMP
Get one or more variables via SNMP
def _get(self, *variables):
        """Get one or more variables via SNMP

        Args:
            Tuple with the variables to fetch via SNMP.

        Returns:
            List of tuples with the fetched keys and values.

        """
        obj_types = []
        for var in variables:
            if isinstance(var, tuple):
                obj = ObjectType(
                    ObjectIdentity(self.mib, var[0],
                                   var[1]).addMibSource(self.mib_dir))
            else:
                obj = ObjectType(
                    ObjectIdentity(self.mib, var,
                                   0).addMibSource(self.mib_dir))
            obj_types.append(obj)

        errorIndication, errorStatus, errorIndex, varBinds = next(
            getCmd(self.engine, CommunityData('public'),
                   UdpTransportTarget((self.address, self.port)),
                   ContextData(), *obj_types))

        if errorIndication:
            logger.error(errorIndication)
        elif errorStatus:
            logger.error(
                '%s at %s' %
                (errorStatus.prettyPrint(),
                 errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
        else:
            res = list()
            for varBind in varBinds:
                logger.debug(' = '.join([x.prettyPrint() for x in varBind]))
                res.append(tuple([x.prettyPrint() for x in varBind]))
            return res
def _get ( self , * variables ) : obj_types = [ ] for var in variables : if isinstance ( var , tuple ) : obj = ObjectType ( ObjectIdentity ( self . mib , var [ 0 ] , var [ 1 ] ) . addMibSource ( self . mib_dir ) ) else : obj = ObjectType ( ObjectIdentity ( self . mib , var , 0 ) . addMibSource ( self . mib_dir ) ) obj_types . append ( obj ) errorIndication , errorStatus , errorIndex , varBinds = next ( getCmd ( self . engine , CommunityData ( 'public' ) , UdpTransportTarget ( ( self . address , self . port ) ) , ContextData ( ) , * obj_types ) ) if errorIndication : logger . error ( errorIndication ) elif errorStatus : logger . error ( '%s at %s' % ( errorStatus . prettyPrint ( ) , errorIndex and varBinds [ int ( errorIndex ) - 1 ] [ 0 ] or '?' ) ) else : res = list ( ) for varBind in varBinds : logger . debug ( ' = ' . join ( [ x . prettyPrint ( ) for x in varBind ] ) ) res . append ( tuple ( [ x . prettyPrint ( ) for x in varBind ] ) ) return res