[mrtg] GRE Tunnel mrtg traffic

Mohamed Sangey mohamed at tansat.com
Mon Nov 2 13:17:48 CET 2009


Hi,

Snmp-server community bankm RO

Mohamed Sangey
Chief Technical Officer (CTO)
 
Tel Office:      (+255) 22 - 213 70 30
Support 24/7: (+255) 22 - 550 72 00
Fax:                  (+255) 22 - 213 92 22
Mobile:          (+255) 797 - 200020
Calling from the U.S:  212-372-7219
Calling from Israel:    057-6666555 ext. 4971
Email: mohamed at tansat.com / www.tansat.com
MSN : tansat-support at hotmail.com 

 
 

-----Original Message-----
From: Jan Ferré [mailto:Jan.Ferre at uni-c.dk] 
Sent: Monday, November 02, 2009 2:04 PM
To: Mohamed Sangey
Cc: mrtg at lists.oetiker.ch; lsolano at racsa.co.cr; amokhtar at eventumsolutions.com; s.shipway at auckland.ac.nz; bbolu at hotmail.com
Subject: Re: [mrtg] GRE Tunnel mrtg traffic

Mohamed Sangey wrote:
> Hi,
>
> Router has 4 switch ports 0,1,2,3 and WAN port int fa 4 which shows as port 5 when I fire mrtg for that. This is router cisco 871.
>   
I use this script (requires snmp-tools) to see which interfaces are
available:

#!/bin/bash
# Generates a list of interfaces on a Cisco router

ROUTER=$1

COM=$2
COM=${COM:-public}

snmpwalk -v1 -c $COM $ROUTER IF-MIB::ifIndex | \
   cut -d " " -f4 | \
   while read index
     do
       speed=`snmpget -v1 -c $COM $ROUTER IF-MIB::ifSpeed.$index | cut
-d " " -f4`
       name="`snmpget -v1 -c $COM $ROUTER IF-MIB::ifAlias.$index | cut
-d " " -f4-10`"
       name=${name:-"Without name"}
       desc="`snmpget -v1 -c $COM $ROUTER IF-MIB::ifDescr.$index | cut
-d " " -f4`"
       echo $ROUTER $desc: $name, $speed - snmpindex $index
   done

exit 0

This basicly makes a list of all possible interfaces (the snmpwalk
command) and for each interface gets speed, name and description.

This may give a reply like:
130.226.255.17 Vlan1: Forskerparken Symbion (Kontakt IT Afdelingen),
1000000000 - snmpindex 1
130.226.255.17 Vlan2: Uden navn, 1000000000 - snmpindex 2
130.226.255.17 GigabitEthernet0/1: Forskerparken Symbion (Kontakt IT
Afdelingen), 1000000000 - snmpindex 10101
130.226.255.17 GigabitEthernet0/2: Forskerparken Symbion (Kontakt IT
Afdelingen), 10000000 - snmpindex 10102
130.226.255.17 GigabitEthernet0/3: FSKNET SYMBION-DPU, 1000000000 -
snmpindex 10103
130.226.255.17 GigabitEthernet0/4: FSKNET SYMBION-VER Fiber, 1000000000
- snmpindex 10104
130.226.255.17 Null0: Uden navn, 4294967295 - snmpindex 10501
130.226.255.17 FastEthernet0: Uden navn, 100000000 - snmpindex 10502
130.226.255.17 Loopback1: ID, 4294967295 - snmpindex 20567

Please note the 'weird' snmpindexes - and those are the ones to be used
in mrtg.

Jan Ferré


-- 
Jan Ferré - UNI-C Netdrift - DTU Bygning 304, DK-2800 Lyngby
tlf. +45 3587 8935, cell. +45 2160 8012, fax. +45 3587 8990
EAN-no.: 5798000555198



More information about the mrtg mailing list