Auto-commit

Reply
L2 Linker

Auto-commit

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?

Tags (1)
L5 Sessionator

Re: Auto-commit

As of now there isn't a way to do the same. But there is a feature request(ID: 1041) in place.Please have your SE vote for the same.

L2 Linker

Re: Auto-commit

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

#!/bin/bash

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>

L1 Bithead

Re: Auto-commit

Hi mgentile

 

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!

 

Cheers

 

Stu 

Community Team Member

Re: Auto-commit

Hi @Stuart_Walton,

 

It's run on another device.

Check this link on getting started with the API :

 

Getting Started with the API

 

Cheers !

-Kiwi.

L1 Bithead

Re: Auto-commit

Thanks Kiwi!!!!

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 Live Community as a whole!

The Live Community thanks you for your participation!