Skip to content

Adding initial LIBRENMS mappings for netutils#732

Open
bminnix wants to merge 1 commit into
networktocode:developfrom
bminnix:blm/librenms_lib_mapping
Open

Adding initial LIBRENMS mappings for netutils#732
bminnix wants to merge 1 commit into
networktocode:developfrom
bminnix:blm/librenms_lib_mapping

Conversation

@bminnix

@bminnix bminnix commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Adding a mapping for LibreNMS values to network_driver values for the initial values in use.

@@ -1,4 +1,5 @@
"""Dictionary object to store OUI information."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be needed, and will likely get reverted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this file are coming from ruff rules. I was just following ruff --fix after I realized there was an issue called out by ruff.

@itdependsnetworks

Copy link
Copy Markdown
Contributor

Can you link source of this information for ease of future findings?

@bminnix

bminnix commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

Can you link source of this information for ease of future findings?

I'm not sure the best way to go about doing this since there really isn't a great summarized source, suggestions welcomed.

In the current state this is all coming about as follows:

  1. The "constants.py" file is created with "os_manufacturer_map" and "manufacturer_os_map" (both manually created (by @bile0026) after inspecting the files/contents) with the intent to create those specific mappings. All values from the LibreNMS code/base are in this os/manufacturer mapping.

  2. The non-driver values being added to the LIBRENMS_LIB_MAPPING/REVERSE are ones coming in directly from the devices themselves and being used to map to/from the nautobot network drivers. I believe these device values obtained are all SNMP value based (and how LibreNMS is obtaining device data).

  3. The values in LIB_MAPPER dictionaries are just added after seeing the values that were provided by the devices, and any that throw "Manufacturer mapping not found for OS" get added to the mapping then.

We could go through and try to add a mapping entry for each of the os/manufacturer entries, but there really isn't any great source of info for future findings/requirements.

@jeffkala

Copy link
Copy Markdown
Collaborator

Think you'll need to add a bit to the development_script to to make sure proper doc tables are auto generated since this is a new mapping.

@bminnix bminnix force-pushed the blm/librenms_lib_mapping branch from 9869d30 to f9b292b Compare January 5, 2026 15:50
@bminnix

bminnix commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author

Think you'll need to add a bit to the development_script to to make sure proper doc tables are auto generated since this is a new mapping.

This is done. I had ran the script but forgot to update it first 😬

Comment thread netutils/lib_mapper.py
Comment on lines +148 to +156
# LibreNMS | Normalized
LIBRENMS_LIB_MAPPER_REVERSE = {
"arista_eos": "arista_eos",
"iosxe": "cisco_xe",
"iosxr": "cisco_xr",
"nxos": "cisco_nxos",
"junos": "juniper_junos",
"procera": "applogic_procera",
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# LibreNMS | Normalized
LIBRENMS_LIB_MAPPER_REVERSE = {
"arista_eos": "arista_eos",
"iosxe": "cisco_xe",
"iosxr": "cisco_xr",
"nxos": "cisco_nxos",
"junos": "juniper_junos",
"procera": "applogic_procera",
}
# Normalized | LibreNMS
LIBRENMS_LIB_MAPPER_REVERSE = {
"arista_eos": "arista_eos",
"cisco_xe": "iosxe",
"cisco_nxos": "nxos",
"cisco_xr": "iosxr",
"juniper_junos": "junos",
"applogic_procera": "procera",
}

These are in reverse of what they should be, e.g. juniper_junos is normalized.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The below needs to be flipped as well

Comment thread netutils/lib_mapper.py Outdated
"cisco_nxos": "nxos",
"cisco_xr": "iosxr",
"juniper_junos": "junos",
"applogic_procera": "procera",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this have ssh and be in netmiko? If so, let's try and reserve the name there, if not we need to add it to _MAIN_LIB_MAPPER

Updating for comments and conflicts.
@bminnix bminnix force-pushed the blm/librenms_lib_mapping branch from 33070bb to f5f32e7 Compare June 29, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants