This code is used to find live hosts on a network, retrieve information about those hosts using Napalm, and create a new device in the Netbox database with specified parameters.
How it works
- Pinging a range of IP addresses to find live hosts and storing them in a CSV file.
- Connecting to the live hosts, retrieving information using Napalm, and printing the result.
- The hosts that respond to a PING but NAPALM is unable to connect to them are displayed on the screen.
- Sending requests to the Netbox API to retrieve lists of device types and roles, and prompting the user to select one of each.
- Sending a request to the Netbox API to create a new device with the specified parameters.
You must create the following in Netbox before executing the script.
- Device Type
- Device Role
- Organization Site