Skip to content

Commit 80d6486

Browse files
committed
Adding LIBRENMS mappings for netutils
1 parent 9a2d7b5 commit 80d6486

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

netutils/lib_mapper.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@
145145
# REMOVE IN 2.X, kept for backward compatibility
146146
DNA_CENTER_LIB_MAPPER_REVERSE = copy.deepcopy(DNACENTER_LIB_MAPPER_REVERSE)
147147

148+
# LibreNMS | Normalized
149+
LIBRENMS_LIB_MAPPER_REVERSE = {
150+
"arista_eos": "arista_eos",
151+
"iosxe": "cisco_xe",
152+
"iosxr": "cisco_xr",
153+
"nxos": "cisco_nxos",
154+
"junos": "juniper_junos",
155+
"procera": "applogic_procera",
156+
}
157+
148158
# Normalized | Netmiko
149159
NETMIKO_LIB_MAPPER: t.Dict[str, str] = {
150160
"a10": "a10",
@@ -640,7 +650,18 @@
640650
"paloalto_panos": "PAN_OS",
641651
}
642652

653+
# Normalized | LibreNMS
654+
LIBRENMS_LIB_MAPPER = {
655+
"arista_eos": "arista_eos",
656+
"cisco_xe": "iosxe",
657+
"cisco_nxos": "nxos",
658+
"cisco_xr": "iosxr",
659+
"juniper_junos": "junos",
660+
"applogic_procera": "procera",
661+
}
662+
643663
# Normalized | NIST
664+
<<<<<<< Updated upstream
644665
NIST_LIB_MAPPER_REVERSE: t.Dict[str, str] = {
645666
"arista_eos": "arista:eos",
646667
"aruba_os": "arubanetworks:arubaos",
@@ -651,6 +672,31 @@
651672
"cisco_xr": "cisco:ios_xr",
652673
"juniper_junos": "juniper:junos",
653674
"paloalto_panos": "paloaltonetworks:pan-os",
675+
=======
676+
NIST_LIB_MAPPER_REVERSE = {
677+
"arista_eos": "eos",
678+
"aruba_os": "arubaos",
679+
"cisco_asa": "adaptive_security_appliance_software",
680+
"cisco_ios": "ios",
681+
"cisco_nxos": "nx-os",
682+
"cisco_xe": "ios_xe",
683+
"cisco_xr": "ios_xr",
684+
"juniper_junos": "junos",
685+
"paloalto_panos": "pan-os",
686+
}
687+
688+
# Normalized | NIST reverse dictionary parser for NIST URL generation.
689+
NIST_TO_VENDOR = {
690+
"arista_eos": {"vendor": "arista", "os_name": "eos"},
691+
"aruba_os": {"vendor": "arubanetworks", "os_name": "arubaos"},
692+
"cisco_asa": {"vendor": "cisco", "os_name": "adaptive_security_appliance_software"},
693+
"cisco_ios": {"vendor": "cisco", "os_name": "ios"},
694+
"cisco_nxos": {"vendor": "cisco", "os_name": "nx-os"},
695+
"cisco_xe": {"vendor": "cisco", "os_name": "ios_xe"},
696+
"cisco_xr": {"vendor": "cisco", "os_name": "ios_xr"},
697+
"juniper_junos": {"vendor": "juniper", "os_name": "junos"},
698+
"paloalto_panos": {"vendor": "paloaltonetworks", "os_name": "pan-os"},
699+
>>>>>>> Stashed changes
654700
}
655701

656702
# Deep copy the reverse, where there is no actual translation happening with special
@@ -693,6 +739,7 @@
693739
"dna_center": DNACENTER_LIB_MAPPER,
694740
"forward_networks": FORWARDNETWORKS_LIB_MAPPER,
695741
"hier_config": HIERCONFIG_LIB_MAPPER,
742+
"librenms": LIBRENMS_LIB_MAPPER,
696743
"napalm": NAPALM_LIB_MAPPER,
697744
"netmiko": NETMIKO_LIB_MAPPER,
698745
"netutils_parser": NETUTILSPARSER_LIB_MAPPER,
@@ -711,6 +758,7 @@
711758
"dna_center": DNACENTER_LIB_MAPPER_REVERSE,
712759
"forward_networks": FORWARDNETWORKS_LIB_MAPPER_REVERSE,
713760
"hier_config": HIERCONFIG_LIB_MAPPER_REVERSE,
761+
"librenms": LIBRENMS_LIB_MAPPER_REVERSE,
714762
"napalm": NAPALM_LIB_MAPPER_REVERSE,
715763
"netmiko": NETMIKO_LIB_MAPPER_REVERSE,
716764
"netutils_parser": NETUTILSPARSER_LIB_MAPPER_REVERSE,

0 commit comments

Comments
 (0)