fw.refresh_ha_active() functionality

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Please sign in to see details of an important advisory in our Customer Advisories area.

fw.refresh_ha_active() functionality

L3 Networker

Hi @gfreeman  and all 


I am trying to use refresh_ha_active() functionality so that script always run on active device.  As per my understanding once i set the peer it will check internally and run it on active box or my understanding is wrong here ? I am trying to run test route cmd to pull interface details and then later run test security cmd and in order that we need to always connect to active box to pull details . I am trying below . Could you please suggest on below  : 


NOTE:  If i am giving device1 IP active device member and device2 IP standby IP , this works fine . However if i am giving device1 IP as standby and device2 IP as active , then its failing as from standby its not pulling interface details.


deviceip1 = input('Enter device FQDN/IP: ')
deviceip2 = input('Enter device2 FQDN/IP: ')
user = input('Enter username: ')

fw = Firewall(deviceip1, user, getpass())


srcip = input ('Enter SOURCE IP: ')
dstip = input ('Enter DEST IP: ')
dstport = input ('Enter dstport: ')
proto = input('Enter protocol number: ')

z1 = fw.xapi.op(cmd='<test><routing><fib-lookup><virtual-router>default</virtual-router><ip>{}</ip></fib-lookup></routing></test>'.format(srcip) , cmd_xml=False)

<< truncated output  >>


1 accepted solution

Accepted Solutions

Agree with @gfreeman .  Also, I responded with details on your GitHub issue over here:  https://github.com/PaloAltoNetworks/pandevice/issues/210

View solution in original post


L5 Sessionator

So when you do fw.xapi.(whatever) you are bypassing all the stuff pandevice can do for you.  Since you are wanting pandevice to intervene, you should stick with fw.op() instead of doing fw.xapi.op().


Also, fw.op() has a param retry_on_peer that defaults to False.  I'm not sure, but try setting that to True and see if it works?

Agree with @gfreeman .  Also, I responded with details on your GitHub issue over here:  https://github.com/PaloAltoNetworks/pandevice/issues/210

Thanks @btorresgil , @gfreeman 


I will test it and update you .



@btorresgil , @gfreeman 



Thanks for your help . It's working now.



  • 1 accepted solution
  • 4 replies
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!