10-24-2017 06:34 AM - edited 03-01-2019 06:12 PM
Hi, I do need to deploy two lines of config to a few hundred network devices. The devices do exist in Prime, but I only want to deploy the config to a portion of the devices.
I have have a list (csv) with the IP-addresses of the devices, is it possible to deploy the config based on the list through Prime?
10-24-2017 07:41 AM
- Presumably not as seen from the link below :
- I don't think it's possible to import a list as a 'change target' ; if someone found workarounds; glad to here.
10-24-2017 09:01 AM
You could do this with the NBI. From your CSV, which I'm assuming is just the IP addresses of the devices you want to update, you will need to determine the device ID.
for ip in $(cat ipAddress.csv)
curl -k -u username:password https://$piHost/webacs/api/v1/data/Devices?ipAddress="$ip"| grep Devices/
done > deviceIdList.txt
From that list you can turn it into the body of the XML that you need to send in the second step. It needs to look like this:
<?xml version="1.0" encoding="UTF-8"?>
Then use that to PUT the XML file. Once you do that, it will apply the template to those devices.
curl -k -u username:password -X PUT \
-H 'content-type: text/xml' -d @deviceListTemplate.xml
10-24-2017 10:08 AM
This assumes, of course, that you have already created a template for the command lines that you want to deploy.
The other assumption that I made was that the template does not have any parameters. If you need to send parameters to the template for each device, that's a bit different.
For help with using templates and the NBI, consult the /nbi_help page for details on what you need to send in the various NBI calls.
With curl and the shell, you can get pretty far. You can get even further with some real Python behind it.
10-24-2017 10:15 PM
- I do acknowlegde the technical knowledge of your answers but in the end the product should evolve to include such tasks automatically for the requested functionality ; which would create great added value. It's a bit like having a banking app and saying : 'but if you need to transfer money to a series of multiple recipients simultaniously , you need to learn Fortran first!
10-25-2017 06:04 AM
11-13-2017 03:43 AM
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: