Unable to get output of 'show rule-hit-count...' via panxapi.py or xapi.py

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Unable to get output of 'show rule-hit-count...' via panxapi.py or xapi.py

Hi All,

 

Wondering if anyone has been able to successfully get the output of the following command via either the panxapi.py wrapper or via their own functions that make use of the xapi.py module:

 

PS C:\Program Files (x86)\Python37-32\Scripts> python .\panxapi.py -Xjro 'show rule-hit-count vsys vsys-name vsys1 rule-base security rules all'
op: error [code="17"]: " show -> rule-hit-count -> vsys -> vsys-name -> vsys1 unexpected here
show -> rule-hit-count -> vsys -> vsys-name is invalid"
PS C:\Program Files (x86)\Python37-32\Scripts>

 

I thought maybe I was doing something wrong while writing my own wrapper for xapi.py, but after using the panxapi.py wrapper I get the exact same response from a PA 820 running version 8.0.10.

 

It is probably also worth mentioning that this exact string can be run as a command on the 820 via SSH, and I receive the expected output.

 

All input welcome.

 

Thanks!

 

2 REPLIES 2

L5 Sessionator

You'll need to specify the XML yourself for that command.  There are multiple variables that you're specifying with this command, so the automatic XML-ification that the libraries do will fail.

 

Using debug cli on specified here, the XML the op command is sending on my firewall looks like this:

 

<show><rule-hit-count><vsys><vsys-name><entry name='vsys1'><rule-base><entry name='security'><rules><all/></rules></entry></rule-base></entry></vsys-name></vsys></rule-hit-count></show>

Thanks I'll give this a shot and send it in XML.

  • 4587 Views
  • 2 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!