<?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 Python - Check Panorama Template - Certificates expiration in Panorama Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/panorama-discussions/python-check-panorama-template-certificates-expiration/m-p/541465#M1538</link>
    <description>&lt;P&gt;Hello everyone, I hope you are doing well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We had an issue with certificate that as expired on one of our customer's device.&lt;BR /&gt;I know it exist this Github : &lt;A href="https://github.com/ip-life-net/palo-check-cert-expiry" target="_self"&gt;https://github.com/ip-life-net/palo-check-cert-expiry&lt;/A&gt; and it works flawlessly with one device but, I try to figure out how to do this on Panorama&lt;/P&gt;
&lt;P&gt;I found the SDK and seems to be a good starting point but, it does not offer easy way to get the information. &lt;BR /&gt;After some search, I know I'll need to do it in two steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 1 : Get template from Panorama&lt;BR /&gt;Step 2 : Loop into each template and find the information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I missed something, but can't see someone doing this already here and into the &lt;A href="https://github.com/PaloAltoNetworks/pan-os-python" target="_blank" rel="noopener"&gt;pan-os-python Github&lt;/A&gt; community. &lt;/P&gt;
&lt;P&gt;I'm using Panorama 10.1.9-h1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, I'm able to get template list with this code :&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from panos.firewall import Firewall
from panos.panorama import Panorama, Template

host = "EDITED"
API_KEY = "EDITED"
pano = Panorama(host,api_key=API_KEY)
rawdata = pano.op('show templates',xml=True)
print(rawdata)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Someone did ever see this somewhere?&lt;/P&gt;
&lt;P&gt;Thank you all and have a great day. &lt;/P&gt;</description>
    <pubDate>Mon, 08 May 2023 18:03:58 GMT</pubDate>
    <dc:creator>vegiardj</dc:creator>
    <dc:date>2023-05-08T18:03:58Z</dc:date>
    <item>
      <title>Python - Check Panorama Template - Certificates expiration</title>
      <link>https://live.paloaltonetworks.com/t5/panorama-discussions/python-check-panorama-template-certificates-expiration/m-p/541465#M1538</link>
      <description>&lt;P&gt;Hello everyone, I hope you are doing well!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We had an issue with certificate that as expired on one of our customer's device.&lt;BR /&gt;I know it exist this Github : &lt;A href="https://github.com/ip-life-net/palo-check-cert-expiry" target="_self"&gt;https://github.com/ip-life-net/palo-check-cert-expiry&lt;/A&gt; and it works flawlessly with one device but, I try to figure out how to do this on Panorama&lt;/P&gt;
&lt;P&gt;I found the SDK and seems to be a good starting point but, it does not offer easy way to get the information. &lt;BR /&gt;After some search, I know I'll need to do it in two steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step 1 : Get template from Panorama&lt;BR /&gt;Step 2 : Loop into each template and find the information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe I missed something, but can't see someone doing this already here and into the &lt;A href="https://github.com/PaloAltoNetworks/pan-os-python" target="_blank" rel="noopener"&gt;pan-os-python Github&lt;/A&gt; community. &lt;/P&gt;
&lt;P&gt;I'm using Panorama 10.1.9-h1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually, I'm able to get template list with this code :&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;from panos.firewall import Firewall
from panos.panorama import Panorama, Template

host = "EDITED"
API_KEY = "EDITED"
pano = Panorama(host,api_key=API_KEY)
rawdata = pano.op('show templates',xml=True)
print(rawdata)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Someone did ever see this somewhere?&lt;/P&gt;
&lt;P&gt;Thank you all and have a great day. &lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2023 18:03:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/panorama-discussions/python-check-panorama-template-certificates-expiration/m-p/541465#M1538</guid>
      <dc:creator>vegiardj</dc:creator>
      <dc:date>2023-05-08T18:03:58Z</dc:date>
    </item>
  </channel>
</rss>

