From 80d6486c472caf02d2dbc860a0d33553f13f428b Mon Sep 17 00:00:00 2001 From: Brandon Minnix Date: Fri, 7 Nov 2025 15:55:49 -0500 Subject: [PATCH 1/3] Adding LIBRENMS mappings for netutils --- netutils/lib_mapper.py | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/netutils/lib_mapper.py b/netutils/lib_mapper.py index f0446161..093c3366 100644 --- a/netutils/lib_mapper.py +++ b/netutils/lib_mapper.py @@ -145,6 +145,16 @@ # REMOVE IN 2.X, kept for backward compatibility DNA_CENTER_LIB_MAPPER_REVERSE = copy.deepcopy(DNACENTER_LIB_MAPPER_REVERSE) +# 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 | Netmiko NETMIKO_LIB_MAPPER: t.Dict[str, str] = { "a10": "a10", @@ -640,7 +650,18 @@ "paloalto_panos": "PAN_OS", } +# Normalized | LibreNMS +LIBRENMS_LIB_MAPPER = { + "arista_eos": "arista_eos", + "cisco_xe": "iosxe", + "cisco_nxos": "nxos", + "cisco_xr": "iosxr", + "juniper_junos": "junos", + "applogic_procera": "procera", +} + # Normalized | NIST +<<<<<<< Updated upstream NIST_LIB_MAPPER_REVERSE: t.Dict[str, str] = { "arista_eos": "arista:eos", "aruba_os": "arubanetworks:arubaos", @@ -651,6 +672,31 @@ "cisco_xr": "cisco:ios_xr", "juniper_junos": "juniper:junos", "paloalto_panos": "paloaltonetworks:pan-os", +======= +NIST_LIB_MAPPER_REVERSE = { + "arista_eos": "eos", + "aruba_os": "arubaos", + "cisco_asa": "adaptive_security_appliance_software", + "cisco_ios": "ios", + "cisco_nxos": "nx-os", + "cisco_xe": "ios_xe", + "cisco_xr": "ios_xr", + "juniper_junos": "junos", + "paloalto_panos": "pan-os", +} + +# Normalized | NIST reverse dictionary parser for NIST URL generation. +NIST_TO_VENDOR = { + "arista_eos": {"vendor": "arista", "os_name": "eos"}, + "aruba_os": {"vendor": "arubanetworks", "os_name": "arubaos"}, + "cisco_asa": {"vendor": "cisco", "os_name": "adaptive_security_appliance_software"}, + "cisco_ios": {"vendor": "cisco", "os_name": "ios"}, + "cisco_nxos": {"vendor": "cisco", "os_name": "nx-os"}, + "cisco_xe": {"vendor": "cisco", "os_name": "ios_xe"}, + "cisco_xr": {"vendor": "cisco", "os_name": "ios_xr"}, + "juniper_junos": {"vendor": "juniper", "os_name": "junos"}, + "paloalto_panos": {"vendor": "paloaltonetworks", "os_name": "pan-os"}, +>>>>>>> Stashed changes } # Deep copy the reverse, where there is no actual translation happening with special @@ -693,6 +739,7 @@ "dna_center": DNACENTER_LIB_MAPPER, "forward_networks": FORWARDNETWORKS_LIB_MAPPER, "hier_config": HIERCONFIG_LIB_MAPPER, + "librenms": LIBRENMS_LIB_MAPPER, "napalm": NAPALM_LIB_MAPPER, "netmiko": NETMIKO_LIB_MAPPER, "netutils_parser": NETUTILSPARSER_LIB_MAPPER, @@ -711,6 +758,7 @@ "dna_center": DNACENTER_LIB_MAPPER_REVERSE, "forward_networks": FORWARDNETWORKS_LIB_MAPPER_REVERSE, "hier_config": HIERCONFIG_LIB_MAPPER_REVERSE, + "librenms": LIBRENMS_LIB_MAPPER_REVERSE, "napalm": NAPALM_LIB_MAPPER_REVERSE, "netmiko": NETMIKO_LIB_MAPPER_REVERSE, "netutils_parser": NETUTILSPARSER_LIB_MAPPER_REVERSE, From e49c92fd05e9ab285c137e34345cf18c6093e080 Mon Sep 17 00:00:00 2001 From: Brandon Minnix Date: Mon, 10 Nov 2025 09:45:32 -0500 Subject: [PATCH 2/3] Added the librenms mapper dictionaries --- netutils/lib_mapper.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/netutils/lib_mapper.py b/netutils/lib_mapper.py index 093c3366..2c32da44 100644 --- a/netutils/lib_mapper.py +++ b/netutils/lib_mapper.py @@ -661,7 +661,6 @@ } # Normalized | NIST -<<<<<<< Updated upstream NIST_LIB_MAPPER_REVERSE: t.Dict[str, str] = { "arista_eos": "arista:eos", "aruba_os": "arubanetworks:arubaos", @@ -672,31 +671,6 @@ "cisco_xr": "cisco:ios_xr", "juniper_junos": "juniper:junos", "paloalto_panos": "paloaltonetworks:pan-os", -======= -NIST_LIB_MAPPER_REVERSE = { - "arista_eos": "eos", - "aruba_os": "arubaos", - "cisco_asa": "adaptive_security_appliance_software", - "cisco_ios": "ios", - "cisco_nxos": "nx-os", - "cisco_xe": "ios_xe", - "cisco_xr": "ios_xr", - "juniper_junos": "junos", - "paloalto_panos": "pan-os", -} - -# Normalized | NIST reverse dictionary parser for NIST URL generation. -NIST_TO_VENDOR = { - "arista_eos": {"vendor": "arista", "os_name": "eos"}, - "aruba_os": {"vendor": "arubanetworks", "os_name": "arubaos"}, - "cisco_asa": {"vendor": "cisco", "os_name": "adaptive_security_appliance_software"}, - "cisco_ios": {"vendor": "cisco", "os_name": "ios"}, - "cisco_nxos": {"vendor": "cisco", "os_name": "nx-os"}, - "cisco_xe": {"vendor": "cisco", "os_name": "ios_xe"}, - "cisco_xr": {"vendor": "cisco", "os_name": "ios_xr"}, - "juniper_junos": {"vendor": "juniper", "os_name": "junos"}, - "paloalto_panos": {"vendor": "paloaltonetworks", "os_name": "pan-os"}, ->>>>>>> Stashed changes } # Deep copy the reverse, where there is no actual translation happening with special From 9869d303bbc2791c1df67ecccf99fb959c55a021 Mon Sep 17 00:00:00 2001 From: Brandon Minnix Date: Mon, 10 Nov 2025 09:50:27 -0500 Subject: [PATCH 3/3] Fixed ruff format issue --- netutils/data_files/oui_mappings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/netutils/data_files/oui_mappings.py b/netutils/data_files/oui_mappings.py index e2e8c597..f1c34ffd 100644 --- a/netutils/data_files/oui_mappings.py +++ b/netutils/data_files/oui_mappings.py @@ -1,4 +1,5 @@ """Dictionary object to store OUI information.""" + # pylint: disable=too-many-lines import typing