IP Fabric webhook for automated remediation
IP Fabric network discovery can collect the network state. Release 3.7.0 introduced webhooks.
Let’s see how webhooks can be used for automated remediation.
In a common brownfield scenario, an existing network is carefully configured box-by-box by
CLI huggers network engineers.
It is not unusual to forget to save the configuration after a quick network change while multitasking. Even in the best network designs an
unexpected reboot unplanned redundancy test can have an impact if a device reboots with an old configuration.
The remediation usually involves getting the latest backup from some repository and pushing the configuration to the box. If the configuration backup is not updated or missing the time to recover can be quite long.
A saved configuration check is available when a user forgets to save a changed configuration. IP Fabric compares the actual (running) configuration with the saved (startup) configuration and the results can be found in Technology → Management → Saved Config Consistency table.
The same workflow can be applied to any check.
- IP Fabric executes a network discovery
- when the discovery completes a webhook is sent to a listener running on a Linux box
- the listener queries IP Fabric via API to verify if any device fails the saved configuration check mentioned before
- if any device fails the check, a script is executed to apply the remediation (save the configuration) only where necessary (the non compliant devices)
Details of the implementation
For this demo I used:
- FastAPI as listener of the webhook
- nornir_ipfabric module to collect the inventory from IP Fabric
- netmiko to send commands to the devices
This video shows a demo of the process:
Automated remediation can be a starting point for a larger network automation initiative.
In this demo we fixed the issue in the workflow itself. In some cases, when a more conservative approach is preferable, remediation could be as simple as opening a support ticket to engage a network engineer to apply manually the fix.
Leveraging IP Fabric’s automated discovery, data normalization, webhooks, and API we can implement an automation workflow minimizing the necessary code and all the associated additional work and risks.
Don’t forget to subscribe to my youtube channel , I will posts more details about the webhook implementation soon.
IP Fabric website
Listen about IP Fabric on IPSpace Software Gone Wild Podcast