- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
07-26-2012 07:39 AM
Hi all,
I am trying to get the cluster states of our two PA Firewalls (active/passive) through the XML API. I am particular interested in the "state" values of both members. The only thing I was able to retrieve was https://hostname/api/?type=op&cmd=%3Cshow%3E%3Chigh-availability%3E%3Call%3E%3C%2Fall%3E%3C%2Fhigh-a...
But for monitoring purpose (PRTG) I just need the "<local-info><state>" part of the whole output. How can I do that ? What is the API URL for just that information ?
thanks Roland
07-26-2012 04:12 PM
There's a little example in panxapi(1) from PAN-perl which shows how to get to some data in type=op XML output.
Print operational command variable using shell pipeline. | |
$ (panxapi -t pa-200 -Xpro 'show system info'; | |
> echo 'print $VAR1->{system}->{"av-version"},"\n"') | perl | |
op: success | |
641-875 |
You could also try to find what you are looking for in sysd (show system state ...) which doesn't get everything wrapped in XML when using the API type=op request.
07-26-2012 11:35 PM
thanks, but I need an API URL a script does not help in that case.
07-27-2012 11:03 AM
Hi Roland,
The currently available API in 4.1.x does not allow you to query single specific values from the output returned. The operational commands available through the API simply map to the equivalent commands available through the CLI. The application calling the API would need to parse the output to limit the response to just the value required.
Thanks,
-- Kevin
08-01-2012 04:28 PM
Note that there are some configuration mode commands that can be performed via type=op API requests.
For example, check and save. This isn't documented as far as I know.
$ panxapi -t pa-200 -Xxo 'check pending-changes'
op: success
<response status="success"><result>no</result></response>
$ panxapi -t pa-200 -Xxo 'save config'
op: success
<response status="success"><result>Config saved to .snapshot.xml</result></response>
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!