Pan Configurator Failing to download Panorama Config

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

Pan Configurator Failing to download Panorama Config

L1 Bithead

I have configured the latest version of the PAN-Configurator. 

I have created my API key from a superuser account. 

when I tried to issue a command to label some rules it fails

 

php rules-edit.php in=api://192.168.0.10 ruletype=security location=NDH1-CHC-FW actions=tag-Add:REV4DELeltion 'filter=(rule is.disabled)'

I get the following error:

---------------------------------------------------------------------------------

- Downloading config from API... 

* ** ERROR ** * <config> was not found

XML line #-1, XPATH: /result

<#document>

 <result>

  <response status="success">

  </response>

 </result>

</#document>

 

 

 *** Backtrace ***

0 ****

       derr()

       ::/home/expedition/pan-configurator/lib/misc-classes/class-PanAPIConnector.php line 1327

1 ****

   PanAPIConnector:192.168.0.10

       PanAPIConnector::getSavedConfig() @

           /home/expedition/pan-configurator/lib/misc-classes/class-PanAPIConnector.php line 1303

2 ****

   PanAPIConnector:192.168.0.10

       PanAPIConnector::getCandidateConfig() @

           /home/expedition/pan-configurator/utils/rules-edit.php line 374

 

-----------------------------------------------------------------------------

 

any ideas would be appreciated!

8 REPLIES 8

Cyber Elite
Cyber Elite

@Kaliman,

Did you ever have PAN Configurator working before or is this a new instance that you are trying to get up and working? Since you're getting an error on the initial configuration grab I would take the key that you generated and verify simply using the standard API that your key is actually operating successfully to pull the candidate config. 

/api/?type=op&cmd=<show><config><candidate></candidate></config></show>&key=$key

@BPry 
Thank you for your time.
this tool was working before. However it has been a long time I tried. 

I tried your command and I was getting an error with the syntax.

expedition@Expedition:~/pan-configurator/utils$ /api/?type=op&cmd=<show><config><candidate></candidate></config></show>&key="key"

-bash: syntax error near unexpected token `<'

However, I tried to test with pan-python command and I got a successful response: 

kaliman@OP bin % python panxapi.py -h 192.168.0.10 -K "KEY" -xr -s "/config/devices/entry/deviceconfig/system/hostname"

show: success

<hostname>panoramalocal</hostname>

Kaliman@OP bin % 
My question to you is, how can I reset my pan-configurator key?

I am wondering if I made a mistake on the key. 

L4 Transporter

@Kaliman The key in the command is you API key. Here are instructions of how to get it: 

 

https://docs.paloaltonetworks.com/pan-os/9-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api...

 

Have you done a software upgrade recently? It is possible that Panconfigurator does not support the latest PanOS. 

hello Batd2,

Thank you for your KB,

I meant to say, on PAN-Configurator, when I first connected, it requested the API key, I am afraid that I did not copy the whole string. in the subsequent connections. it did not request, so I may be stored somewhere. How can I delete it and try again?

Test reply pz Ignore

Admin

LIVEcommunity Admin

@Kaliman ,

The API key itself will be stored at .panconfkeystore in your systems user folder the first time you run the API connection type. If you think you did that incorrectly you can use the pa_key-manager script like so to set a new key:

pa_key-manager delete=MGMT-IP
pa_key-manager add=MGMT-IP

 

Also your calling this by it's old name of panconfigurator, I just want to verify that you are aware of the pan-os-php library where this is actively supported and getting updates. The old panconfigurator repo is still kicking around, but you would want to be using pan-os-php repo so you actually get the latest updates. 

@batd2 pz ignore - Test for notifications 😎

Admin

LIVEcommunity Admin

L3 Networker

I just saw these comments related to pan-configurator.

Please be aware that I continued pan-configurator under a new name and repository:
https://github.com/PaloAltoNetworks/pan-os-php

It has all the same functionality from the past, but more features and improved handling.
I am also working on an PAN-OS-PHP API, PAN-OS-PHP GUI in additional to the still available PAN-OS-PHP CLI.


To bring in some information about to answer the problem from March 2021, where it was not possible to download Panorama configuration.
This problem is related to a PAN-OS problem and was fixed in May 2021 by Palo Alto Networks, but I also introduced a work around,
if I am not mistaken at this time also public in pan-configurator.


For any feature request, please feel free to open an Github issue.

Regards
Sven

  • 5989 Views
  • 8 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!