Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/765.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add a Library Mapper for LibreNMS obtained values in order to map with existing network_drivers.
12 changes: 12 additions & 0 deletions development_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,18 @@
"_dict": lib_mapper.HIERCONFIG_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/hierconfig_reverse.md",
},
"librenms": {
"header_src": "LIBRENMS",
"header_dst": "NORMALIZED",
"_dict": lib_mapper.LIBRENMS_LIB_MAPPER,
"_file": "docs/user/lib_mapper/librenms.md",
},
"librenms_reverse": {
"header_src": "NORMALIZED",
"header_dst": "LIBRENMS",
"_dict": lib_mapper.LIBRENMS_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/librenms_reverse.md",
},
"napalm": {
"header_src": "NAPALM",
"header_dst": "NORMALIZED",
Expand Down
8 changes: 8 additions & 0 deletions docs/user/lib_mapper/librenms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| LIBRENMS | | NORMALIZED |
| ---------- | -- | ------ |
| applogic_procera | → | procera |
| arista_eos | → | arista_eos |
| cisco_nxos | → | nxos |
| cisco_xe | → | iosxe |
| cisco_xr | → | iosxr |
| juniper_junos | → | junos |
8 changes: 8 additions & 0 deletions docs/user/lib_mapper/librenms_reverse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| NORMALIZED | | LIBRENMS |
| ---------- | -- | ------ |
| arista_eos | → | arista_eos |
| iosxe | → | cisco_xe |
| iosxr | → | cisco_xr |
| junos | → | juniper_junos |
| nxos | → | cisco_nxos |
| procera | → | applogic_procera |
1 change: 1 addition & 0 deletions netutils/data_files/oui_mappings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Dictionary object to store OUI information."""

# pylint: disable=too-many-lines
import typing

Expand Down
22 changes: 22 additions & 0 deletions netutils/lib_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -640,6 +650,16 @@
"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
NIST_LIB_MAPPER_REVERSE: t.Dict[str, str] = {
"arista_eos": "arista:eos",
Expand Down Expand Up @@ -693,6 +713,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,
Expand All @@ -711,6 +732,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,
Expand Down