When I use the API to pull the device-state - am I getting the latest device state?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

When I use the API to pull the device-state - am I getting the latest device state?

L0 Member

In another article here, from 2014 (precambrian issues) - they broke down some of the insides of the device state config backup.

One of the commands listed said that I should issue the "save device state" command from the config cli - only - it's no longer there.

My script worked brilliantly for pulling the configs down on my Mac - just want to make sure I'm getting valid configs and don't have to do something else to get these accurately.

 

echo "Building list of firewalls to collect from panorama"
curl -X GET 'https://panorama/api/?type=op&cmd=<show><devices><all></all></devices></show>&key=Your_API_Key_Here=' -o devices.xml
xmllint --format devices.xml | grep -e "<ip-address>" | sed "s/ip-address//g;s/\<//g;s/\>//g;s/\///g;s/ //g" > iplist.txt
echo "Pulling device-state backups from all firewalls"
filename="iplist.txt"
while IFS= read fw;
do
curl -k -X GET 'https://'$fw'/api/?type=export&category=device-state&key=Your_API_Key_Here=' -o device_state_cfg-$fw.tgz
done < "$filename"

 

0 REPLIES 0
  • 1885 Views
  • 0 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!