Skip to content

Commit

Permalink
Merge pull request #636 from nautobot/integration_librenms
Browse files Browse the repository at this point in the history
Add LibreNMS Integration
  • Loading branch information
jdrew82 authored Jan 14, 2025
2 parents dbb167a + ace735a commit 4476f07
Show file tree
Hide file tree
Showing 39 changed files with 3,464 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/nautobot_ssot/integrations/infoblox/ @qduk @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/ipfabric/ @alhogan @nautobot/plugin-ssot
/nautobot_ssot/integrations/itential/ @jtdub @nautobot/plugin-ssot
/nautobot_ssot/integrations/librenms/ @bile0026 @nautobot/plugin-ssot
/nautobot_ssot/integrations/meraki/ @jdrew82 @nautobot/plugin-ssot
/nautobot_ssot/integrations/servicenow/ @glennmatthews @qduk @nautobot/plugin-ssot
/nautobot_ssot/integrations/slurpit/ @lpconsulting321 @pietos @nautobot/plugin-ssot
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This Nautobot application framework includes the following integrations:
- Infoblox
- IPFabric
- Itential
- LibreNMS
- Cisco Meraki
- ServiceNow
- Slurpit
Expand Down Expand Up @@ -93,6 +94,7 @@ The SSoT framework includes a number of integrations with external Systems of Re
* Cisco DNA Center
* Infoblox
* Itential
* LibreNMS
* Cisco Meraki
* ServiceNow
* Slurpit
Expand Down
1 change: 1 addition & 0 deletions changes/636.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added LibreNMS integration.
6 changes: 6 additions & 0 deletions development/development.env
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,10 @@ NAUTOBOT_SSOT_ENABLE_ITENTIAL="True"
NAUTOBOT_SSOT_ENABLE_SLURPIT="False"
SLURPIT_HOST="https://sandbox.slurpit.io"


NAUTOBOT_SSOT_ENABLE_LIBRENMS="False"
NAUTOBOT_SSOT_LIBRENMS_SYSTEM_OF_RECORD="LibreNMS"
NAUTOBOT_SSOT_LIBRENMS_HOSTNAME_FIELD="sysName" # hostname or sysName

NAUTOBOT_SSOT_ENABLE_SOLARWINDS="False"

1 change: 1 addition & 0 deletions development/nautobot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@
"enable_infoblox": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_INFOBLOX")),
"enable_ipfabric": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_IPFABRIC")),
"enable_itential": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_ITENTIAL")),
"enable_librenms": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_LIBRENMS", "false")),
"enable_meraki": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_MERAKI")),
"enable_servicenow": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_SERVICENOW")),
"enable_slurpit": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_SLURPIT")),
Expand Down
1 change: 1 addition & 0 deletions docs/admin/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Set up each integration using the specific guides:
- [Infoblox](./integrations/infoblox_setup.md)
- [IPFabric](./integrations/ipfabric_setup.md)
- [Itential](./integrations/itential_setup.md)
- [LibreNMS](./integrations/librenms_setup.md)
- [Cisco Meraki](./integrations/meraki_setup.md)
- [ServiceNow](./integrations/servicenow_setup.md)
- [Slurpit](./integrations/slurpit_setup.md)
Expand Down
1 change: 1 addition & 0 deletions docs/admin/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This Nautobot app supports the following integrations:
- [Infoblox](./infoblox_setup.md)
- [IPFabric](./ipfabric_setup.md)
- [Itential](./itential_setup.md)
- [LibreNMS](./librenms_setup.md)
- [Cisco Meraki](./meraki_setup.md)
- [ServiceNow](./servicenow_setup.md)
- [Slurpit](./slurpit_setup.md)
Expand Down
46 changes: 46 additions & 0 deletions docs/admin/integrations/librenms_setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# LibreNMS

## Description

This App will sync data from the LibreNMS API into Nautobot to create Device and IPAM inventory items. Most items will receive a custom field associated with them called "System of Record", which will be set to "LibreNMS" (or whatever you set the `NAUTOBOT_SSOT_LIBRENMS_SYSTEM_OF_RECORD` environment variable to). These items are then the only ones managed by the LibreNMS SSoT App. Other items within the Nautobot instance will not be affected unless there's items with overlapping names. If an item exists in Nautobot by it's identifiers but it does not have the "System of Record" custom field on it, the item will be updated with "LibreNMS" (or `NAUTOBOT_SSOT_LIBRENMS_SYSTEM_OF_RECORD` environment variable value) when the App runs. This way no duplicates are created, and the App will not delete any items that are not defined in the LibreNMS API data but were manually created in Nautobot.

## Installation

Before configuring the integration, please ensure, that `nautobot-ssot` app was [installed with LibreNMS integration extra dependencies](../install.md#install-guide).

```shell
pip install nautobot-ssot[librenms]
```

## Configuration

Once the SSoT package has been installed you simply need to enable the integration by setting `enable_librenms` to True.

```python
PLUGINS = ["nautobot_ssot"]

PLUGINS_CONFIG = {
"nautobot_ssot": {
# Other nautobot_ssot settings ommitted.
"enable_librenms": is_truthy(os.getenv("NAUTOBOT_SSOT_ENABLE_LIBRENMS", "true")),
}
}
```

### External Integrations

#### LibreNMS as DataSource

The way you add your LibreNMS server instance is through the "External Integrations" objects in Nautobot. First, create a secret in Nautobot with your LibreNMS API token using an Environment Variable (or sync via secrets provider). Then create a SecretsGroup object and select the Secret you just created and set the Access Type to `HTTP(S)` and the Secret Type to `Token`.

Once this is created, go into the Extensibility Menu and select `External Integrations`. Add an External Intergration with the Remote URL being your LibreNMS server URL (including http(s)://), set the method to `GET`, and select any other headers/settings you might need for your specific instance. Select the secrets group you created as this will inject the API token. Once created, you will select this External Integration when you run the LibreNMS to Nautobot SSoT job.

![LibreNMS External Integration](../../images/librenms-external-integration.png)

#### LibreNMS as DataTarget

NotYetImplemented

### LibreNMS API

An API key with global read-only permissions is the minimum needed to sync information from LibreNMS.
Binary file added docs/images/librenms-external-integration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/user/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This Nautobot app supports the following integrations:
- [Infoblox](./infoblox.md)
- [IPFabric](./ipfabric.md)
- [Itential](./itential.md)
- [LibreNMS](./librenms.md)
- [Cisco Meraki](./meraki.md)
- [ServiceNow](./servicenow.md)
- [Slurpit](./slurpit.md)
Expand Down
35 changes: 35 additions & 0 deletions docs/user/integrations/librenms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Usage

## Process

### LibreNMS as DataSource

The LibreNMS SSoT integration is built as part of the [Nautobot Single Source of Truth (SSoT)](https://github.com/nautobot/nautobot-app-ssot) app. the SSoT app enables Nautobot to be the aggregation point for data coming from multiple systems of record (SoR).

#### Job Options

- Debug: Additional Logging
- Librenms Server: External integration object pointing to the required LibreNMS instance.
- hostname_field: Which LibreNMS field to use as the hostname in Nautobot. sysName or hostanme.
- sync_location_parents: Whether to lookup City and State to add parent locations for geo locations.
- tenant: This is used as a filter for objects synced with Nautobot and LibreNMS. This can be used to sync multiple LibreNMS instances into different tenants, like in an MSP environment. This affects which devices are loaded from Nautobot during the sync. It does not affect which devices are loaded from LibreNMS

From LibreNMS into Nautobot, the app synchronizes devices, their interfaces, associated IP addresses, and Locations. Here is a table showing the data mappings when syncing from LibreNMS.

| LibreNMS objects | Nautobot objects |
| ----------------------- | ---------------------------- |
| geo location | Location |
| device | Device |
| interface | Interface |
| device os | Platform/Manufacturer `*` |
| os version | Software/SoftwareImage |
| ip address | IPAddress |
| hardware | DeviceType |


`*` Device OS from LibreNMS is not standardized and therefore there is a mapping that can be updated in the `constants.py` file for the integration as more device manufacturers and platforms need to be added.

### LibreNMS as DataTarget

Not yet implemented.

2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ nav:
- Infoblox: "user/integrations/infoblox.md"
- IPFabric: "user/integrations/ipfabric.md"
- Itential: "user/integrations/itential.md"
- LibreNMS: "user/integrations/librenms.md"
- Cisco Meraki: "user/integrations/meraki.md"
- ServiceNow: "user/integrations/servicenow.md"
- Slurpit: "user/integrations/slurpit.md"
Expand All @@ -138,6 +139,7 @@ nav:
- Infoblox: "admin/integrations/infoblox_setup.md"
- IPFabric: "admin/integrations/ipfabric_setup.md"
- Itential: "admin/integrations/itential_setup.md"
- LibreNMS: "admin/integrations/librenms_setup.md"
- Cisco Meraki: "admin/integrations/meraki_setup.md"
- ServiceNow: "admin/integrations/servicenow_setup.md"
- SolarWinds: "admin/integrations/solarwinds_setup.md"
Expand Down
2 changes: 2 additions & 0 deletions nautobot_ssot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ class NautobotSSOTAppConfig(NautobotAppConfig):
"dna_center_show_failures": True,
"enable_aci": False,
"enable_aristacv": False,
"enable_bootstrap": False,
"enable_device42": False,
"enable_dna_center": False,
"enable_citrix_adm": False,
"enable_infoblox": False,
"enable_ipfabric": False,
"enable_librenms": False,
"enable_meraki": False,
"enable_servicenow": False,
"enable_slurpit": False,
Expand Down
Loading

0 comments on commit 4476f07

Please sign in to comment.