Api/v0/oxidized Only Yields 3 Fields

Hello,

I’ve integrated Oxidized into our LibreNMS system. We don’t use hostnames to add new devices via SNMP we use the device IP. When I run Oxidized, I have to use the mapping “ip: hostname” to be able to have Oxidized ssh and pull the configs. When I curl the API at https://127.0.0.1:8080/api/v0/oxidized, I only get 3 fields, hostname, os, ip. I don’t get the “sysName” field which is where the actual device hostname is stored. Is there a way to add fields that Oxidized can pull?

root@librenms:/opt/librenms/config# curl -H ‘X-Auth-Token: TOKEN’ -k https://127.0.0.1:8080/api/v0/oxidized
[
{
“hostname”: “10.X.X.X”,
“os”: “ios”,
“ip”: “10.X.X.X”
}

From the doco (which looks maybe a touch old): Devices - LibreNMS Docs

That function is here, and matches exactly what you see:

The query in that code pulls many other fields you could add to the output in the $output structure.

I don’t know what the convention is with all these, but you could add all the relevant ones and submit a pull request to start the discussion so others can benefit from your changes too.

you can use mapping in oxidized config under source section

map:
  hostname: sysName

Ah thanks! That appears to be what I’m looking for as the fields are in the query just not the output.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.