Subject: [USR-TC] MRTG

From: Ralph Forsythe <[email-masked]>
Date: Tue, 13 Aug 2002 17:56:38 +0000

Ok, does anyone have a brief explanation, or example of a config, for using 
MRTG with a Netserver / Total Control?  I would like to monitor the number 
of modems in use out of the total active ports (which could change from 
time to time - re-making the config is ok there if I need to), and possibly 
the total bandwidth usage - either per port, total, or both.

I tried following the example found at the link below, but just got a lot 
of MRTG errors after playing with various options, and figured someone 
might just be able to post a snippet of their config file.
http://www.dcr.net/~mandrews/usrtoys/mrtg.shtml

I know a tremendous amount of information can be gathered frrom SNMP on 
these things, I just don't know much about how to do it...

Thanks,
-rf

---

From: Support <[email-masked]>
Date: Tue, 13 Aug 2002 18:08:52 +0000

I was just going to post the same message about MRTG.  We get far less
information about the users online than we did with our older Equinox
equipment.  Of course, on the upside, the 3com stuff actually works days on
end without a reboot unlike the Equinox stuff.

Todd Chamberlain

----- Original Message -----
From: "Ralph Forsythe" <[email-masked]>
To: <[email-masked]>
Sent: Tuesday, August 13, 2002 11:52 AM
Subject: [USR-TC] MRTG

> _______________________________________________
> USR-TC mailing list
> [email-masked]
> http://mailman.xmission.com/cgi-bin/mailman/listinfo/usr-tc
>

---

From: WebMaster <[email-masked]>
Date: Tue, 13 Aug 2002 18:13:15 +0000

Here's what we use.

------- MRTG CONFIG FILE -----
#
# FloodCity Modem Racks
#

# Default Settings

WorkDir: /net/www/admin/stats/modems/
Interval: 5
Refresh: 300
AddHead[_]: <link href="modems.css" rel="stylesheet" text="text/css">
Background[_]: #dfdfdf
Options[_]: growright, noinfo, gauge
Unscaled[_]: dwmy
WithPeak[_]: dwmy
YLegend[_]:Modem Capacity
ShortLegend[_]:Modems
Legend1[_]:&nbsp Utilization &nbsp
Legend2[_]:&nbsp Capacity &nbsp
Legend3[_]:&nbsp Connections &nbsp
Legend4[_]:&nbsp Capacity &nbsp
LegendI[_]:&nbsp Utilization &nbsp
LegendO[_]:&nbsp Capacity &nbsp

# JT01

Target[jt01]: `./get_hiper <snmp_read_comm>@<nmc_ip>`
MaxBytes[jt01]: 240
Title[jt01]: JT01
PageTop[jt01]: <div align="center">
 <table border="1" cellpadding="2" cellspacing="0" width="500">
 <tr><td bgcolor="#000080" align="center"><font color="#ffffff" face="'MS Sans
Serif',sans-serif"><b>JT01</b><
/font></td></tr>
 <tr><td bgcolor="#ffffff" align="center"><table border="0">
 <tr><td><small>Capacity:</small></td><td><small>240 lines</small></td></tr>
 </table>
 </td></tr></table>

----- END MRTG CONFIG FILE ----

----- get_hiper.pl script -----

#!/usr/bin/perl

# dualt1.pl
#

#
# Created by  Eric Billeter
# returns:
# Modems in use (value1)
# Chassis capacity (value2)

use SNMP_Session;
use BER;
use Socket;
use strict;

%snmpget::OIDS = (  'value1' =>  '1.3.6.1.4.1.429.1.27.2.1.26',
                 );

my($community,$router) = split /\@/, $ARGV[0];
die <<USAGE  unless $community && $router;

USAGE: dualt1.pl 'SNMP_community'\@'aaa.bbb.ccc.ddd'

Where 'aaa.bbb.ccc.ddd' is the ip address for the Network Management Card.

USAGE

my($sysName,$sysUptime,$interfaces,$value1,$value2) =
    snmpgettable($router,$community,'value1');

exit(0);

sub snmpgettable{
  my($host,$community,$var) = @_;
  my($next_oid,$enoid,$orig_oid,
     $response, $bindings, $binding, $value, $inoid,$outoid,
     $upoid,$oid,@table,$tempo);
  die "Unknown SNMP var $var\n"
    unless $snmpget::OIDS{$var};

  $orig_oid = encode_oid(split /\./, $snmpget::OIDS{$var});
  $enoid=$orig_oid;
  srand();
  my $session = SNMP_Session->open ($host ,
                                 $community,
                                 161);
  for(;;)  {
    if ($session->getnext_request_response(($enoid))) {
      $response = $session->pdu_buffer;

      ($bindings) = $session->decode_get_response ($response);
      ($binding,$bindings) = decode_sequence ($bindings);
      ($next_oid,$value) = decode_by_template ($binding, "%O%@");
      # quit once we are outside the table
      last unless BER::encoded_oid_prefix_p($orig_oid,$next_oid);

        my $bulkindex = 2;
        while( $bulkindex < "50" ){

        $tempo = substr ($value,$bulkindex,1);

        $bulkindex=$bulkindex+2;
        if( ord($tempo) eq '5' or ord($tempo) eq '3' or ord($tempo) eq '22'
){$value1=$value1 + 1 ;
                }
        if( ord($tempo) eq '2' or ord($tempo) eq '5' or ord($tempo) eq '3' or
ord($tempo) eq '22' ){$value2=$va
lue2 + 1 ;
                }
        }
      push @table, $tempo;
    } else {
      die "No answer from $ARGV[0]\n";
    }
    $enoid=$next_oid;
  }
  $session->close ();
if( $value1 eq ''){$value1 = 0 };
if( $value2 eq ''){$value2 = 0 };
     print "$value1\n";
     print "$value2\n";
  return (@table);
}

----- end get_hiper.pl script -----

 Note: Beware of line wrapping.

 Hope this helps,

Allen

> Ok, does anyone have a brief explanation, or example of a config, for using  MRTG with
> a Netserver / Total Control?  I would like to monitor the number  of modems in use out
> of the total active ports (which could change from  time to time - re-making the
> config is ok there if I need to), and possibly  the total bandwidth usage - either per
> port, total, or both.
>
> I tried following the example found at the link below, but just got a lot  of MRTG
> errors after playing with various options, and figured someone  might just be able to
> post a snippet of their config file.
> I know a tremendous amount of information can be gathered frrom SNMP on  these things,
> I just don't know much about how to do it...
>
> Thanks,
> -rf
>
>

---

From: Lewis Bergman <[email-masked]>
Date: Wed, 14 Aug 2002 10:41:33 +0000

> the total bandwidth usage - either per port, total, or both.

Make sure you look this over and change what needs to be changed. NOTE - I 
like my graphs to grow left not right so you may want to add the "growright" 
option.
######################################################################
# Description: 3Com Corporation HiPer Access Router Card Built on Jan 10 2002 
at 12:07:57.
#     Contact: Lewis Bergman
# System Name: totconabi1
#    Location: Abilene
#.....................................................................
#

### Concurrent Modem Users >> Descr: 'U.S.Robotics Concurrent User's ###

# This Report File Template measures Concurrent Modem Users
# on a 3Com HiPer Arc
#
# Example CFGNAME: [DEVICE NAME]-hiper_arc_concurrent_users

Target[3comTC.modem]: 
1.3.6.1.4.1.429.4.2.1.10.0&1.3.6.1.4.1.429.4.2.1.10.0:[email-masked]
MaxBytes[3comTC.modem]: 192
Unscaled[3comTC.modem]: dwm
Title[3comTC.modem]: totconabi1 3Com Total Control Modem Usage
PageTop[3comTC.modem]: <H1>totconabi1 3Com Total Control Modem Usage</H1>
Options[3comTC.modem]: gauge, unknaszero
YLegend[3comTC.modem]: Modem Users
ShortLegend[3comTC.modem]: users
Colours[3comTC.modem]: GREEN#00eb0c,BLUE#0000ff,GRAY#AAAAAA,VIOLET#ff00ff
Legend1[3comTC.modem]: Concurrent Modem Users
Legend2[3comTC.modem]: .
Legend3[3comTC.modem]: Max value per interval on graph
Legend4[3comTC.modem]: .
LegendI[3comTC.modem]: Users:&nbsp;
LegendO[3comTC.modem]: .
WithPeak[3comTC.modem]: ymw

#------------------------------------------------------------------

Target[3comTC.pub]: 3:[email-masked]
MaxBytes[3comTC.pub]: 1250000
Title[3comTC.pub]: totconabi1 (HiperARC): Ethernet pub
PageTop[3comTC.pub]: <H1>totconabi1 Traffic Analysis for Ethernet pub
 </H1>
 <TABLE>
   <TR><TD>System:</TD><TD>totconabi1 in Abilene</TD></TR>
   <TR><TD>Maintainer:</TD><TD>Lewis Bergman</TD></TR>
   <TR><TD>Interface:</TD><TD>Ethernet Driver (3)</TD></TR>
   <TR><TD>IP:</TD><TD>No hostname defined for IP address 
(208.29.17.203)</TD></TR>
   <TR><TD>Max Speed:</TD>
       <TD>1250.0 KBytes/s (ethernetCsmacd)</TD></TR>
  </TABLE>

#---------------------------------------------------------------

Target[3comTC.priv]: 4:[email-masked]
MaxBytes[3comTC.priv]: 1250000
Title[3comTC.priv]: totconabi1 (HiperARC): Ethernet priv
PageTop[3comTC.priv]: <H1>totconabi1 Traffic Analysis for Ethernet priv
 </H1>
 <TABLE>
   <TR><TD>System:</TD><TD>totconabi1 in Abilene</TD></TR>
   <TR><TD>Maintainer:</TD><TD>Lewis Bergman</TD></TR>
   <TR><TD>Interface:</TD><TD>Ethernet Driver (4)</TD></TR>
   <TR><TD>IP:</TD><TD>No hostname defined for IP address 
(192.168.1.203)</TD></TR>
   <TR><TD>Max Speed:</TD>
       <TD>1250.0 KBytes/s (ethernetCsmacd)</TD></TR>
  </TABLE>

#---------------------------------------------------------------

Target[3comTC.ram]: 
1.3.6.1.4.1.429.4.3.1.3.0&1.3.6.1.4.1.429.4.3.1.3.0:[email-masked]
MaxBytes[3comTC.ram]: 100000
AbsMax[3comTC.ram]: 262144
Title[3comTC.ram]: totconabi1 Free memory on HiPerARC
PageTop[3comTC.ram]: <h1>totconabi1 Free memory on HiPerARC</h1>
Options[3comTC.ram]: gauge
YLegend[3comTC.ram]: Kbytes free
ShortLegend[3comTC.ram]: Kbytes free
LegendI[3comTC.ram]:  sys-mem:
LegendO[3comTC.ram]:  real-mem:

#---------------------------------------------------------------

Target[3comTC.heat]: 
1.3.6.1.4.1.429.1.2.2.5.0&1.3.6.1.4.1.429.1.2.2.5.0:[email-masked]
MaxBytes[3comTC.heat]: 100
Title[3comTC.heat]: totconabi1 Temperature
PageTop[3comTC.heat]: <h1>totconabi1 Temperature</h1>
Options[3comTC.heat]: gauge
YLegend[3comTC.heat]: Degrees C
ShortLegend[3comTC.heat]: Degrees C

#---------------------------------------------------------------

-- 
Lewis Bergman
Texas Communications
4309 Maple St.
Abilene, TX 79602-8044
915-695-6962 ext 115

---

From: Aaron Nabil <[email-masked]>
Date: Wed, 14 Aug 2002 16:40:21 +0000

If I want to upgrade my ARC's to 128k ram and 16k flash, how do I do
it?  Do I need to order them from 3COM?  When you swap the flash out, do
you lose the software and/or configuration?  

thx,

Aaron