<?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: The command &amp;quot;Show systems statistics session&amp;quot; in a daily report? in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/272040#M74882</link>
    <description>this command provides a snapshot of the current throughput of the system, displaying this on a daily basis would skew you statistics (packets per second averaged out over 86400 seconds per day)

if you want a tally of the days totals you can create a report that lists the amount of packets and bytes received/transmitted
alternatively you can monitor the system via SNMP and graph out the usage on an external RRDtool like cacti</description>
    <pubDate>Fri, 21 Jun 2019 08:55:06 GMT</pubDate>
    <dc:creator>reaper</dc:creator>
    <dc:date>2019-06-21T08:55:06Z</dc:date>
    <item>
      <title>The command "Show systems statistics session" in a daily report?</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/270236#M74702</link>
      <description>&lt;P&gt;I would like the information displayed in the "Show systems statistics session" CLI command to be packaged into a daily report so that I could see the previous day's throughput, packet rate, TCP sessions, etc and displayed in nice line graphs.&amp;nbsp; Is there such a report?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Update&lt;/P&gt;&lt;P&gt;I solved this by using the XML API and a Powershell script (below) which is attached to a scheduled task that executes every minute.&amp;nbsp; I found that the "show session info" command, and its API analog, shows the same info as the "show system statistics session" but in a passive format.&amp;nbsp; Using the XML API and a script I exported the "show session info" data to XML and parsed it into a nice CSV file.&amp;nbsp; I'm going to let the script collect data for a few weeks and then I'll take the resutling CSV files and chart their data in Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the script I used:&lt;/P&gt;&lt;PRE&gt;$paloList = "palo1.example.com","palo2.example.com"
$queryUri="/api/?type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;session&amp;gt;&amp;lt;info&amp;gt;&amp;lt;/info&amp;gt;&amp;lt;/session&amp;gt;&amp;lt;/show&amp;gt;&amp;amp;key=API KEY GOES HERE"
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "USERNAME","PASSWORD")))

$results =@()

foreach($fw in $paloList)
{
    $fullUrl="https://"+$fw+$queryUri
    try
    {
        [xml]$systemStats = Invoke-WebRequest -uri $fullUrl -Method Get -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
    }
    catch
    {
        Write-Host "StatusCode:" $_.Exception.Response.StatusCode.value__ 
        Write-Host "StatusDescription:" $_.Exception.Response.StatusDescription
    }

    [object]$statsInfo = $systemStats.response.result | Select-Object pps,kbps,num-active,num-icmp,num-tcp,num-udp

    $results += New-Object -TypeName psobject -Property @{
            "Date"=get-date -Format "MM-dd-yyyy";
            "Time"=get-date -Format "hh:mm:ss";
            "Packet rate"=$statsInfo.pps;
            "Throughput"=$statsInfo.kbps;
            "Total active sessions"=$statsInfo.'num-active';
            "Active TCP sessions"=$statsInfo.'num-tcp';
            "Active UDP sessions"=$statsInfo.'num-udp';
            "Active ICMP sessions"=$statsInfo.'num-icmp'}

    $filename = $fw+"_statsInfo.csv"
    $results | select Date,Time,"Packet rate",Throughput,"Total active sessions","Active TCP sessions","Active UDP sessions","Active ICMP sessions" | export-csv $PSScriptRoot\$filename -NoTypeInformation -Append
}&lt;/PRE&gt;&lt;P&gt;-Note 1: I have multiple devices that I'm pulling data from hence the loop.&lt;/P&gt;&lt;P&gt;-Note 2: You need to get yourself an API key for your device.&amp;nbsp; I found that an API key from one device worked on another, but YMMV.&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/get-your-api-key#" target="_blank"&gt;https://docs.paloaltonetworks.com/pan-os/7-1/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/get-your-api-key#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Note 3: The resulting CSV file is saved to the same folder as the script.&lt;/P&gt;&lt;P&gt;-Note 4: The data is appended to the CSV file(s).&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 20:07:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/270236#M74702</guid>
      <dc:creator>RandomDisplayName</dc:creator>
      <dc:date>2019-06-25T20:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: The command "Show systems statistics session" in a daily report?</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/270287#M74709</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/40724"&gt;@RandomDisplayName&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;This isn't something that is readily available, however you could make it yourself if you log the output and then make the graphs with the information you have stored.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2019 22:38:43 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/270287#M74709</guid>
      <dc:creator>BPry</dc:creator>
      <dc:date>2019-06-15T22:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: The command "Show systems statistics session" in a daily report?</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/272040#M74882</link>
      <description>this command provides a snapshot of the current throughput of the system, displaying this on a daily basis would skew you statistics (packets per second averaged out over 86400 seconds per day)

if you want a tally of the days totals you can create a report that lists the amount of packets and bytes received/transmitted
alternatively you can monitor the system via SNMP and graph out the usage on an external RRDtool like cacti</description>
      <pubDate>Fri, 21 Jun 2019 08:55:06 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/the-command-quot-show-systems-statistics-session-quot-in-a-daily/m-p/272040#M74882</guid>
      <dc:creator>reaper</dc:creator>
      <dc:date>2019-06-21T08:55:06Z</dc:date>
    </item>
  </channel>
</rss>

