kosctelecom / horus

Horus is a distributed tool to collect snmp and icmp metrics from various network equipments and send the results to kafka, NATS.io, prometheus, and/or influxDB
Other
18 stars 2 forks source link

Exported data ifPhysAddress from agents #8

Open chrisho95 opened 2 years ago

chrisho95 commented 2 years ago

Hi,

I'm trying to pool the information of the mac addresses of the different devices from Horus.

The polling goes well but the agents do not expose the results.

Looks like Horus doesn't recognize the "PhysAddress" data type.

"ID": 39,
 "Name": "ifPhysAddress",
 "Oid": ".1.3.6.1.2.1.2.2.1.6",
 "Description": "The interface address at the protocol layer immediately below the network layer in the protocol stack.",
 "PollingFrequency": 0,
 "LastPolledAt": null,
 "Active": true,
 "ExportAsLabel": false,
 "ExportedName": "if_phys_address",
 "PostProcessors": []
}

Reponse:

[I] 2021-12-14 09:43:42.409962 - CdK5EptWH@3 - con#2: res map for group indexed oid .1.3.6.1.2.1.2.2.1.6: 97 metrics [I] 2021-12-14 09:43:42.410015 - CdK5EptWH@3 - con#2: done walking indexed oid .1.3.6.1.2.1.2.2.1.6 [ifPhysAddress]: took 14ms

{"oid":".1.3.6.1.2.1.2.2.1.6","name":"ifPhysAddress","exported_name":"if_physaddress","description":"The interface address at the protocol layer immediately below the network layer in the protocol stack.","value":"**\u0000\ufffd\ufffdﻫ_**","index":"36044800"}

The type of value "ifPhysAddress" is PHYSADDRESS.

BR,

Christophe.

vma commented 2 years ago

Hi, The PhysAddress type is not implemented by the underlying gosnmp library.

You can create a feature request there to add this type (their readme has instructions on how to do that).

Another possibility would be to add a specific post-processor for this metric to convert the output to a mac address. I'll see what I can do as unfortunately I don't have access to a test environment anymore. It would help me a lot if you can send me by PM the output of horus-query for this specific query at debug level -d3 with the corresponding tcpdump.