there a way to set the auto-commit on a schedule?, and if i have changes of configuration pending, the autocommit will apply the changes?
Solved! Go to Solution.
I wrote a small Bash script that you can schedule with cron to perform a nightly auto-commit via the API. If you need help getting started with the API, this doc was awesome: https://live.paloaltonetworks.com/docs/DOC-4126
$ cat panorama-commit.sh
wget --no-check-certificate 'https://hostname.com/api/?type=commit&cmd=<commit></commit>&key=*****SUPERLONGAPIKEYJUNK********' -O - >> commitlog.txt
Make sure to remove global read access to the script because it contains the API key. Here's the cron table. Make sure to have the path you're executing the script from configured in the cron tab. I edited mine out for brevity.
$ crontab -l
0 8 * * * ./panorama-commit.sh
Sample log output:
$ cat commitlog.txt
<response status="success" code="19"><result><msg><line>Commit job enqueued with jobid 2274</line></msg><job>2274</job></result></response>
I was interested to read your post about scheduling a commit on your Palo's. I had thought that something could be done with crontab and when I read your post i was really pleased.
However, I do have a question...
Have you written the bash script and run it from another server/device or is the script located on your Palo and you have scheduled using the Palo's crontab? If you have done it on the Palo how have you accessed the crontab? where did you locate the script? can you provide a little more detail? I'll be honest linux/unix are not my forte - I know a little to get by!
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!