<?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 OID for network topology in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/oid-for-network-topology/m-p/135438#M47507</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got one request where the client is asking about the OID for L2/L3 topology and arp cache table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the following article but it doesn't have any reference for the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/t5/Management-Articles/SNMP-for-Monitoring-Palo-Alto-Networks-Devices/ta-p/61052" target="_blank"&gt;https://live.paloaltonetworks.com/t5/Management-Articles/SNMP-for-Monitoring-Palo-Alto-Networks-Devices/ta-p/61052&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sharief&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 05:40:35 GMT</pubDate>
    <dc:creator>MohamedSharief</dc:creator>
    <dc:date>2017-01-03T05:40:35Z</dc:date>
    <item>
      <title>OID for network topology</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/oid-for-network-topology/m-p/135438#M47507</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got one request where the client is asking about the OID for L2/L3 topology and arp cache table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the following article but it doesn't have any reference for the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/t5/Management-Articles/SNMP-for-Monitoring-Palo-Alto-Networks-Devices/ta-p/61052" target="_blank"&gt;https://live.paloaltonetworks.com/t5/Management-Articles/SNMP-for-Monitoring-Palo-Alto-Networks-Devices/ta-p/61052&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sharief&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 05:40:35 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/oid-for-network-topology/m-p/135438#M47507</guid>
      <dc:creator>MohamedSharief</dc:creator>
      <dc:date>2017-01-03T05:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: OID for network topology</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/oid-for-network-topology/m-p/135468#M47508</link>
      <description>&lt;P&gt;I’m not sure what you mean with L2/L3 topology, but (as far as I know!) there’s no OID for reading the ARP cache. That’s why I created a perl script to&amp;nbsp;do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im using Cacti to graph the arp cache and alerts on to high by 90% of total (see &lt;A href="https://live.paloaltonetworks.com/t5/General-Topics/SNMP-and-ARP/m-p/135208#M47480" target="_self"&gt;this&lt;/A&gt; post), but maybe you can use the script for other monitoring tools?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script uses the &lt;SPAN&gt;PAN-OS XML API, and can read the arp cache, the number of sessions, the number of user's found by user-id and the throughput, but can easily be extended.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;use strict;
use warnings;
use URI::Escape;
use LWP::UserAgent;  
use HTTP::Request;
use XML::LibXML;

my $type        = $ARGV[0]; 
my $hostname    = $ARGV[1]; 
my $apikey    = $ARGV[2]; 

my $command;
if($type eq "arp")          {$command = "&amp;lt;show&amp;gt;&amp;lt;arp&amp;gt;&amp;lt;entry name='all'/&amp;gt;&amp;lt;/arp&amp;gt;&amp;lt;/show&amp;gt;";}
elsif($type eq "userid")    {$command = "&amp;lt;show&amp;gt;&amp;lt;user&amp;gt;&amp;lt;ip-user-mapping&amp;gt;&amp;lt;all&amp;gt;&amp;lt;option&amp;gt;count&amp;lt;/option&amp;gt;&amp;lt;/all&amp;gt;&amp;lt;/ip-user-mapping&amp;gt;&amp;lt;/user&amp;gt;&amp;lt;/show&amp;gt;";}
else                        {$command = "&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;";}
 
my $urlcommand	= uri_escape($command);
my $URL		= 'https://'.$hostname.'/api/?type=op&amp;amp;key='.$apikey.'&amp;amp;cmd='.$urlcommand;

my $xml_string;

my $ua = LWP::UserAgent-&amp;gt;new(ssl_opts =&amp;gt; { verify_hostname =&amp;gt; 0 });
my $header = HTTP::Request-&amp;gt;new(GET =&amp;gt; $URL);  
my $request = HTTP::Request-&amp;gt;new('GET', $URL, $header);  
my $response = $ua-&amp;gt;request($request);  

if ($response-&amp;gt;is_success){  
        $xml_string = $response-&amp;gt;content;
}
elsif ($response-&amp;gt;is_error){  
        print "Error:$URL\n";  
        print $response-&amp;gt;error_as_HTML;  
}

my $parser = XML::LibXML-&amp;gt;new();
my $xmlfile = XML::LibXML-&amp;gt;load_xml(string =&amp;gt; $xml_string);

if($type eq "arp") {
	my($node) = $xmlfile-&amp;gt;findnodes('/response/result/max');
	my $max=$node-&amp;gt;textContent();
	($node) = $xmlfile-&amp;gt;findnodes('/response/result/total');
	my $total=$node-&amp;gt;textContent();
	print "max:".$max." total:".$total."\n";
}
elsif($type eq "userid") {
	my($node) = $xmlfile-&amp;gt;findnodes('/response/result');
	my $userids=$node-&amp;gt;textContent();
	$userids =~ s/"users"/""/g;
	my $userid = substr $userids, 7, length($userids)-15, "";
	print "userids:".$userid."\n";
}
elsif($type eq "sessions") {
	my($node) = $xmlfile-&amp;gt;findnodes('/response/result/num-max');
	my $max=$node-&amp;gt;textContent();
	($node) = $xmlfile-&amp;gt;findnodes('/response/result/num-active');
	my $active=$node-&amp;gt;textContent();
	($node) = $xmlfile-&amp;gt;findnodes('/response/result/num-tcp');
	my $tcp=$node-&amp;gt;textContent();
	($node) = $xmlfile-&amp;gt;findnodes('/response/result/num-udp');
	my $udp=$node-&amp;gt;textContent();
	($node) = $xmlfile-&amp;gt;findnodes('/response/result/num-icmp');
	my $icmp=$node-&amp;gt;textContent();
	print "max:".$max." active:".$active." tcp:".$tcp." udp:".$udp." icmp:".$icmp."\n";
}
else {
	my($node) = $xmlfile-&amp;gt;findnodes('/response/result/kbps');
	my $throughput =$node-&amp;gt;textContent();
	print "throughput:".$throughput."\n";
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 08:38:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/oid-for-network-topology/m-p/135468#M47508</guid>
      <dc:creator>Sjoerd</dc:creator>
      <dc:date>2017-01-03T08:38:48Z</dc:date>
    </item>
  </channel>
</rss>

