Location: PHPKode > projects > LSMS SNMP to MRTG toolset > www/snmpmrtg/arpsummary.php
<?php
// (C)Copyright John Baker 2004/2005/2006
//
// This file is part of lsms2mrtg.
//
// lsms2mrtg is free software;you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation;either version 2 of the License, or
// (at your option) any later version.
//
// lsms2mrtg is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY;without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with lsms2mrtg;if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// For more informationn please visit http://gnulsms2mrtg.sourceforge.net/
include 'generic.inc';
include 'jbsnmplib.inc';
echo $htmlheader;
echo "<HTML><title>ARP Table Summary Page</title>";
error_reporting(0);
$runallot=isallot($host,$community);
$runfortinet=isfortinet($host,$community);
if (snmpget($host,$community, "system.sysObjectID.0")) {
}
else {
    exit("Could not get snmp to ".$community."@".$host."<BR>Please check the host and community");
}


if (isbluecoat($host,$community)) {
$displayarpintdesc=0;
}

echo "<font size=+2 color=$globaltitlecolour><B>ARP Table Summary Page for ".$host."</b></font>";
echo "<HR><BR>";
echo "<font size=+2><u>ARP Table Summary</u></font><BR>";
echo "<table border=1 cellpadding=0 bgcolor=$gentablebg bordercolor=$gentableborder class=\"framelook\" >";
echo "<TH><font color=$gentabletext>Interface</TH>";
if ($displayarpintdesc==1) {
    echo "<TH><font color=$gentabletext>Interface Description</TH>";
}
echo "<TH><font color=$gentabletext>MAC Address</TH>";
echo "<TH><font color=$gentabletext>IP Address</TH>";
echo "<TH><font color=$gentabletext>Status</TH>";
$tmprmon=ipNetToMediaTablearray($host,$community);
$listend=count($tmprmon);
$listcounter=0;
while ($listcounter <= $listend-1) {
    $rmline=$tmprmon[$listcounter];
    echo "<TR>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";
    echo $rmline[0];
    echo "</TD>";
    if ($displayarpintdesc==1) {
        echo "<TD align=left class=\"celllook\"><font color=$gentabletext>";
        if (($rmline[2]=="127.0.0.1") ) {
            echo "Loopback";
        }
        else {
            echo snmpstrip(snmpget($host, $community, ".1.3.6.1.2.1.2.2.1.2.".$rmline[0]));
        }
        echo "</TD>";
    }
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";
if ($rmline[1]=="") echo "0:0:0:0:0:0"; else   echo $rmline[1];
    echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";
    echo $rmline[2];
    echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";
    echo $rmline[3];
    echo "</TD>";
    echo "</TR>";
    $listcounter++;
}
echo "</table>";
echo "<BR>";
jsrefresh();
?>
Return current item: LSMS SNMP to MRTG toolset