Location: PHPKode > projects > LSMS SNMP to MRTG toolset > www/snmpmrtg/rmonsummary.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/
/************************************************************\
EtherStatsEntry ::= SEQUENCE {
    etherStatsIndex Integer32,
    etherStatsDataSource OBJECT IDENTIFIER,
    etherStatsDropEvents Counter32,
    etherStatsOctets Counter32,
    etherStatsPkts  Counter32,
    etherStatsBroadcastPkts Counter32,
    etherStatsMulticastPkts Counter32,
    etherStatsCRCAlignErrors Counter32,
    etherStatsUndersizePkts Counter32,
    etherStatsOversizePkts  Counter32,
    etherStatsFragments Counter32,
    etherStatsJabbers  Counter32,
    etherStatsCollisions Counter32,
    etherStatsPkts64Octets  Counter32,
    etherStatsPkts65to127Octets Counter32,
    etherStatsPkts128to255Octets  Counter32,
    etherStatsPkts256to511Octets  Counter32,
    etherStatsPkts512to1023Octets  Counter32,
    etherStatsPkts1024to1518Octets Counter32,
    etherStatsOwner OwnerString,
    etherStatsStatus EntryStatus
}
\************************************************************/
include 'generic.inc';
include 'jbsnmplib.inc';
echo $htmlheader;
echo "<HTML><title>RMON Summary Page</title>";
error_reporting(0);
if (snmpget($host,$community, "system.sysObjectID.0")) {
}
else {
    exit("Could not get snmp to ".$community."@".$host."<BR>Please check the host and community");
}
echo "<font size=+2 color=$globaltitlecolour><B>RMON Summary Page for ".$host."</b></font>";
echo "<HR><BR>";
echo "<font size=+2><u>Packet Size Summary</u></font><BR>";
echo "<table border=1 cellpadding=0 bgcolor=$gentablebg bordercolor=$gentableborder class=\"framelook\" >";
echo "<TH><font color=$gentabletext>Interface</TH>";
echo "<TH><font color=$gentabletext>64</TH>";
echo "<TH><font color=$gentabletext>65 to 127</TH>";
echo "<TH><font color=$gentabletext>128 to 255</TH>";
echo "<TH><font color=$gentabletext>256 to 511</TH>";
echo "<TH><font color=$gentabletext>512 to 1023</TH>";
echo "<TH><font color=$gentabletext>1024 to 1518</TH>";
echo "<TH><font color=$gentabletext>Collisions</TH>";
$tmprmon=rmonarraysmall($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>".($listcounter+1)."</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[0]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=64","mainright","7");echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[1]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=65","mainright","7");echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[2]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=128","mainright","7");echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[3]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=256","mainright","7");echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[4]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=512","mainright","7");echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[5]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=1024","mainright","7");echo "</TD>";
    echo "<TD align=right class=\"celllook\"><font color=$gentabletext>";echo jsinputbuttonframesize("$rmline[6]","rmon-mrtg.php?host=$host&community=$community&intnum=".($listcounter+1)."&byterange=collisions","mainright","7");echo "</TD>";
    echo "</TR>";
    $listcounter++;
}
echo "</table>";
echo "Please click on value to generate MRTG code<BR>";
echo "<BR>";
jsrefresh();
?>
Return current item: LSMS SNMP to MRTG toolset