Oxidized Integration - LibreNMS Hostname Populated with IP address, Sinatra Error on Config Retrieval

I have LibreNMS populated with IP addresses as hostnames and using the Display Name field for the name. Oxidized has a script that populates a router.db from the main monitoring system, plus specific devices we want to backup. (I am not responsible for everything in the monitoring system, so I need to curate the Oxidized inventory it should backup.) The router.db format is:

The problem I am running into is when you click on the config tab, LibreNMS requests from Oxidized the host by the actual IP address. It appears it uses that to find the correct host and collects the config history, but when it goes to request the current config, it reverts back to the IP address, so the request fails. When I pull up the Oxidized WUI, everything works fine.

An example of the logs: - - [25/Apr/2023:15:58:14 -0400] "GET /node/show/ HTTP/1.1" 200 272 - - [25/Apr/2023:15:58:15 -0400] "GET /node/version?node_full=ACX/lab-acx2200-1&format=json HTTP/1.1" 200 7073 - - [25/Apr/2023:15:58:30 -0400] "GET /node/version/view?node= HTTP/1.1" 500 150160

I have looked at the LibreNMS docs on overriding keys, but I must be missing something because it looks like I can use it to customize groups or OS variables, but I don’t understand how to tell it to use the Display Name, or just the sysName to identify which node we want to access, or why it can request “node_full” by name, but not use something similar to pull the config it’s requesting with the IP address.

Can anyone explain how to tweak LibreNMS config to use the “displayname” or “sysName” as the reference of the device it requests from Oxidized as opposed to the “hostname” field?

If Libre would just request “node=lab-acx2200-1”, then it would get the requested backup.

I’m just beginning to look into this myself. laf helped determine today that sysName is not even added to the array as it’s created in the API function, but I’m also attempting to resolve the IP address field as null since it’ll still need an IP once I start using the sysName. I’ll keep you updated.

Is there a record of that discussion somewhere? I’m not sure I am understand how you are looking at it.

My question is specifically how to have LibreNMS use:

GET /node/version/view?node=lab-acx2200-1

Instead of:

GET /node/version/view?node=

when LibreNMS has the hostname configured as instead of lab-acx2200-1

So, there is no IP address resolution being performed and since my Oxidized is using a router.db files that has a field for the name and a separate field for the IP address, nothing needs to resolve the IP address.

Going by the packet capture, it appears LibreNMS gets REAL close to figuring out the name by IP address, but it wants to request the actual config by the field that is in the hostname. I’m hoping that is what you were saying @laf found the field was not in the array, but without the conversation I have a problem following along.

Yes, it’s around here on Discord - I’m attempting to get LibreNMS to pass Oxidized sysName instead of IP for the hostname, and for the IP field it passes to contain the IP address instead of being null.

I may have misunderstood your initial point of view, but it seems you’re having an issue with what Oxidized sends. Is that right?

I think we are looking at subtly different issues. Correct me if I am wrong, but it sounds like you are referring to Oxidized using LibreNMS as the source of devices to backup and you want to control the fields that LibreNMS answers Oxidized requests with? I am going the other way, in that LibreNMS requests the backup from Oxidized, which LibreNMS use the “Hostname” field as the key. If I understand your use case properly, then it appears we are on the same field, but in opposite ends.

As some background since my original may have been less than clear. I have a script that builds a router.db file as the source for Oxidized and a separate script that builds the inventory for LibreNMS using the API. (I have several LibreNMS VMs, one is just for Juniper and Cisco, another is for Ciena equipment, and other makes/models on a third.) There are different priorities on which devices Oxidized should backup, so I can’t just point Oxidized to any of the LibreNMS servers and have it pull it’s list of devices to backup.

But I have enabled LibreNMS to go to Oxidized and pull up configuration history. So when lab-acx2200-1 is accessed in LibreNMS, it has a config tab. When you click on that tab, LibreNMS performs the GETs I put in my first post and it requests the node by the IP address which is what LibreNMS has as it’s “hostname” field. Oxidized returns the general node data that LibreNMS learns that IP is referred to by the name lab-acx2200-1 and requests the configuration history of that node name. Of the list returned, LibreNMS then requests the current backup, but instead of using the same “name” it just used to get the backup history it uses the IP address (entry in LibreNMS “hostname”) like it did on the first request. Oxidized does not know a host named with the provided IP address, so it returns the Sinatra Error.

I understand that LibreNMS was built with the assumption that hosts would have DNS entries, so some of the newer features, like “Display Name” field aren’t built into the deeper logic of the system. But I saw in the documentation it talking about overriding fields. It specifically mentions using sysName, but the examples appear to be a way use regex to manipulate the values, rather than the use case I am trying to implement.

What I am hoping to do is just substitute the “hostname” with the “sysName” (or display name since I can control that independently in both systems) when LibreNMS interacts with Oxidized to pull data for the “Config” tab on a device. It seems like a simple thing that I just cannot understand how to do. Maybe I am missing something VERY siimple, or maybe it’s just not meant to work that way, so I thought I would ask.

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