Comment 3 for bug 1529539

Revision history for this message
Ke Vo Danh (dacbao91) wrote :

Thanks all, I resolved my problem. My problem is not from pipeline config.

That's from here:

ceilometer-5.0.0/ceilometer/hardware/inspector/snmp.py

I saw method find_matching_oids always return empty array.

def find_matching_oids(oid_cache, oid, match_type, find_one=True):
        matched = []
        if match_type == PREFIX:
            for key in oid_cache.keys():
                # Because "oid" param is string like 1.3.6.1.4.1.2021.4.5.0
                # key is instance like Mibxxxxxx (fomat of snmp :)))
                if key.startswith(oid):
                    matched.append(key)
                    if find_one:
                       break
        else:
            if oid in oid_cache:
                matched.append(oid)
        return matched

--> I try to edit the method :-- > _query_oids(self, host, oids, cache, is_bulk)

# save result into cache
        if is_bulk:
            for var_bind_table_row in data:
                for name, val in var_bind_table_row:
                    # using raw data
                    oid_cache[str(name)] = val
                    # oid_cache[name.prettyPrint()] = val
        else:
            for name, val in data:
                # oid_cache[name.prettyPrint()] = val
                oid_cache[str(name)] = val

and that worked.

Thanks and best regards.