<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Windows Script to connect PaloAlto firewall and run commands in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282064#M1997</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/42784"&gt;@hshawn&lt;/a&gt;&amp;nbsp;fro quick reply and for providing information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going through the link and understanding the way to automate the task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually our tunnel goes down frequently so we are planning to bring up the tunnel with&amp;nbsp; automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to run below commands with API calls?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#show&amp;nbsp;vpn ipsec-sa tunnel &amp;lt;Tunnel name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#test vpn ipsec-sa tunnel &amp;lt;Tunnel name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Aug 2019 14:50:15 GMT</pubDate>
    <dc:creator>DexcomUser</dc:creator>
    <dc:date>2019-08-09T14:50:15Z</dc:date>
    <item>
      <title>Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282049#M1995</link>
      <description>&lt;P&gt;Hi Team&lt;/P&gt;&lt;P&gt;My requirement is:&lt;/P&gt;&lt;P&gt;Run a Python/Powershell script from a windows box which should connect to Palo Alto by command line with SSH connection and run some commands, like "show user group list" or "show system disk-space", It should display the output on screen and store output in a file.&lt;/P&gt;&lt;P&gt;I have found one python script, it works with linux server but when it connects to Palo alto(Verified in the logs) server with SSH connection, It stuck and don't give prompt and after 10min timeout log print.&lt;BR /&gt;Also I am unable to see whether commands run on the Palo Alto server or not, Find below for your reference,&lt;/P&gt;&lt;P&gt;++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;import paramiko&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;os.remove("test.txt")&lt;BR /&gt;ssh = paramiko.SSHClient()&lt;BR /&gt;ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())&lt;BR /&gt;ssh.connect("xx.xx.xx.xx", username="user", password="*********", port=22)&lt;BR /&gt;stdin, stdout, stderr = ssh.exec_command('show system disk-space')&lt;BR /&gt;output = stdout.readlines()&lt;BR /&gt;print (''.join(output))&lt;BR /&gt;file = open('test.txt', 'w')&lt;BR /&gt;file.write(''.join(output))&lt;BR /&gt;file.close()&lt;BR /&gt;+++++++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;P&gt;Where can i see the command run successfully in firewall? Any log?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any other way to run commands from remote server(Windows)? Anyone has automated this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 14:30:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282049#M1995</guid>
      <dc:creator>DexcomUser</dc:creator>
      <dc:date>2019-08-09T14:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282056#M1996</link>
      <description>&lt;P&gt;It would make much more sense to simply send API calls using powershell/python/bash/whatever you like. This can be done quite easily and there is a ton of documentation out there. Take a look at what is available with&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://yourfirewall/php/rest/browse.php" target="_self"&gt;https://yourfirewall/php/rest/browse.php&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.paloaltonetworks.com/pan-os/7-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/7-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 14:37:46 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282056#M1996</guid>
      <dc:creator>hshawn</dc:creator>
      <dc:date>2019-08-09T14:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282064#M1997</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/42784"&gt;@hshawn&lt;/a&gt;&amp;nbsp;fro quick reply and for providing information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going through the link and understanding the way to automate the task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually our tunnel goes down frequently so we are planning to bring up the tunnel with&amp;nbsp; automation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to run below commands with API calls?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#show&amp;nbsp;vpn ipsec-sa tunnel &amp;lt;Tunnel name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#test vpn ipsec-sa tunnel &amp;lt;Tunnel name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 14:50:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282064#M1997</guid>
      <dc:creator>DexcomUser</dc:creator>
      <dc:date>2019-08-09T14:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282066#M1998</link>
      <description>&lt;P&gt;yes you should be able to do that with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;request&amp;gt;&amp;lt;operations&amp;gt;&amp;lt;show&amp;gt;&amp;lt;vpn&amp;gt;&amp;lt;ipsec-sa&amp;gt;&amp;lt;tunnel&amp;gt;yourtunnelnamehere&amp;lt;/tunnel&amp;gt;&amp;lt;/ipsec-sa&amp;gt;&amp;lt;/vpn&amp;gt;&amp;lt;/show&amp;gt;&amp;lt;/operations&amp;gt;&amp;lt;/request&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can run commands and get output that is needed for the API calls by using "debug cli on" then type your command and note the output. NOTE: This executes your commands so if you want to know what API call to use to reboot the dataplane I would not suggest using this method &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:10:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282066#M1998</guid>
      <dc:creator>hshawn</dc:creator>
      <dc:date>2019-08-09T15:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282088#M1999</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/42784"&gt;@hshawn&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks I got the output but it seems different.&lt;/P&gt;&lt;P&gt;Actually not getting proper output,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With command i am getting below output, With this i can understand Phase 1 and 2 are okay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Show IKEv1 IKE SA: Total 4 gateways found. 1 ike sa found.&lt;/P&gt;&lt;P&gt;Show IKEv1 phase2 SA: Total 4 gateways found. 1 ike sa found&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But with the API call i am not getting this output, getting only time, name and algo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry Reboot is not possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i fetch this info, is there any other way to fetch the information ?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:46:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282088#M1999</guid>
      <dc:creator>DexcomUser</dc:creator>
      <dc:date>2019-08-09T15:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282095#M2001</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;show&amp;gt;&amp;lt;running&amp;gt;&amp;lt;tunnel&amp;gt;&amp;lt;flow&amp;gt;&amp;lt;all&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/flow&amp;gt;&amp;lt;/tunnel&amp;gt;&amp;lt;/running&amp;gt;&amp;lt;/show&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the tunnel is down it will show &amp;lt;state&amp;gt;inactive&amp;lt;/state&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 15:59:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282095#M2001</guid>
      <dc:creator>hshawn</dc:creator>
      <dc:date>2019-08-09T15:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282104#M2002</link>
      <description>&lt;P&gt;Thank&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/42784"&gt;@hshawn&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You really saved my time and helped me.&lt;/P&gt;&lt;P&gt;I will test and let you know if i am having any questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 16:41:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282104#M2002</guid>
      <dc:creator>DexcomUser</dc:creator>
      <dc:date>2019-08-09T16:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282279#M2003</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/42784"&gt;@hshawn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked it but VPN tunnel shows UP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tell you the scenario,&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Actually every so often our tunnel goes down but that is not reflected in the firewall section, it shows UP and green color.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we run the below command to check VPN tunnel status, Its showing full details,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt;show vpn ike-sa gateway &amp;lt;Name&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;Show IKEv1 IKE SA: Total 4 gateways found. 1 ike sa found.&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&lt;STRONG&gt;There is no IKEv1 phase-2 SA found. ---- The error we get in the logs and from command&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;our phase-2 authentication is failing which is not refecting in the firwall tunnel status section.&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;So we want to bring it &lt;STRONG&gt;UP&lt;/STRONG&gt; using &lt;STRONG&gt;#test&lt;/STRONG&gt; command.&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;1) How can i fetch full details from API?&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;2) I belive test command will work but will have to find out the status before runnint the test command, Is it possible ?&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="x_MsoNormal"&gt;Thanks in advance ...... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 09:56:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282279#M2003</guid>
      <dc:creator>DexcomUser</dc:creator>
      <dc:date>2019-08-12T09:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Script to connect PaloAlto firewall and run commands</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282474#M2004</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/42784"&gt;@hshawn&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see "success" reply dispite my VPN tunnel status is down.&lt;/P&gt;&lt;P&gt;Could you please let me know alternet way for the same.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srikant Patil&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 12:43:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/windows-script-to-connect-paloalto-firewall-and-run-commands/m-p/282474#M2004</guid>
      <dc:creator>DexcomUser</dc:creator>
      <dc:date>2019-08-13T12:43:24Z</dc:date>
    </item>
  </channel>
</rss>

