def check_table(self, instance, oids, lookup_names, timeout, retries):
        # UPDATE: We used to perform only a snmpgetnext command to fetch metric values.
        # It returns the wrong value when the OID passeed is referring to a specific leaf.
        # For example:
        # snmpgetnext -v2c -c public localhost:11111 1.36.1.2.1.25.4.2.1.7.222
        # iso.3.6.1.2.1.25.4.2.1.7.224 = INTEGER: 2
        # SOLUTION: perform a snmget command and fallback with snmpgetnext if not found
        transport_target = self.get_transport_target(instance, timeout, retries)
        auth_data = self.get_auth_data(instance)

        first_oid = 0
        all_binds = []
        results = defaultdict(dict)

        while first_oid < len(oids):

            # Start with snmpget command
            error_indication, error_status, error_index, var_binds = self.snmpget(
                auth_data,
                transport_target,
                *(oids[first_oid:first_oid + OID_BATCH_SIZE]),
                lookupValues=lookup_names,
                lookupNames=lookup_names)

            # Raise on error_indication
            self.raise_on_error_indication(error_indication, instance)

            # Continue on error_status
            if error_status:
                message = "{0} for instance {1}".format(error_status.prettyPrint(),
                                                        instance["ip_address"])
                instance["service_check_error"] = message
                self.log.warning(message)
                continue

            missing_results = []
            complete_results = []

            for var in var_binds:
                result_oid, value = var
                if reply_invalid(value):
                    oid_tuple = result_oid.asTuple()
                    oid = ".".join([str(i) for i in oid_tuple])
                    missing_results.append(oid)
                else:
                    complete_results.append(var)

            if missing_results:
                # If we didn't catch the metric using snmpget, try snmpnext
                error_indication, error_status, error_index, var_binds_table = self.snmpgetnext(
                    auth_data,
                    transport_target,
                    *missing_results,
                    lookupValues=lookup_names,
                    lookupNames=lookup_names)

                # Raise on error_indication
                self.raise_on_error_indication(error_indication, instance)

                # Continue on error_status
                if error_status:
                    message = "{0} for instance {1}".format(error_status.prettyPrint(),
                                                            instance["ip_address"])
                    instance["service_check_error"] = message
                    self.log.warning(message)
                    continue
                for table_row in var_binds_table:
                    complete_results.extend(table_row)

            all_binds.extend(complete_results)
            first_oid = first_oid + OID_BATCH_SIZE

        for result_oid, value in all_binds:
            if lookup_names:
                _, metric, indexes = result_oid.getMibSymbol()
                results[metric][indexes] = value
            else:
                oid = result_oid.asTuple()
                matching = ".".join([str(i) for i in oid])
                results[matching] = value
        self.log.debug("Raw results: {0}".format(results))
        return results
Perform a snmpwalk on the domain specified by the oids, on the device
dataset/ETHPy150Open serverdensity/sd-agent/checks.d/snmp.py/SnmpCheck.check_table