- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
02-24-2020 09:40 AM
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())
fw.set_ha_peers(Firewall(deviceip2,user,getpass()))
fw.refresh_ha_active()
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 >>
02-27-2020 12:32 PM
Agree with @gfreeman . Also, I responded with details on your GitHub issue over here: https://github.com/PaloAltoNetworks/pandevice/issues/210
02-27-2020 10:30 AM
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?
02-27-2020 12:32 PM
Agree with @gfreeman . Also, I responded with details on your GitHub issue over here: https://github.com/PaloAltoNetworks/pandevice/issues/210
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!