Title[wap11.eth0]: Wap11
MaxBytes[wap11.eth0]: 1250000
Target[wap11.eth0]: `/usr/local/mrtg-2/bin/wap11.pl wap11 public`
PageTop[wap11.eth0]:
<H1>Wap11
</H1>
<TABLE>
<TR><TD>System:</TD><TD>wap11.teuse.net</TD></TR>
<TR><TD>Interface:</TD><TD>wireless</TD></TR>
<TR><TD>IP:</TD><TD>wap11.teuse.net </TD></TR>
</TABLE>


#!/usr/bin/perl
# By Dave Huang 
# public domain

# path to snmpget - part of net-snmp package: http://net-snmp.sourceforge.net
$snmpget = "/usr/bin/snmpget";

# SNMP community name

if (! $ARGV[0] ){
        print "useage: wap11.pl  \n";
        exit;
}
if  (! $ARGV[1] ){
        print "useage: wap11.pl  \n";
        exit;
}



$addr = $ARGV[0];
$commname = $ARGV[1];

# Get enterprises.atmel.atmelmib.atmelSys.EthStatisticsGRP.EthRxStatistics.0
$result = `$snmpget -Oq $addr $commname enterprises.410.1.1.7.1.0`;
$result =~ s/^.*"//;
$result =~ y/"\n //d;
@rxvals = unpack("V22", pack("H176", $result));

# Get enterprises.atmel.atmelmib.atmelSys.EthStatisticsGRP.EthTxStatistics.0
$result = `$snmpget -Oq $addr $commname enterprises.410.1.1.7.2.0`;
$result =~ s/^.*"//;
$result =~ y/"\n //d;
@txvals = unpack("V22", pack("H176", $result));

print "$rxvals[0]\n$txvals[0]\nunknown uptime\n$addr\n";