[comp.archives] [comp.dcom.sys.cisco] IP Accounting via SNMP

pte900@jatz.aarnet.edu.au (Peter Elford) (09/26/90)

Archive-name: gwacc/25-Sep-90
Original-posting-by: pte900@jatz.aarnet.edu.au (Peter Elford)
Original-subject: IP Accounting via SNMP
Archive-site: aarnet.edu.au [130.56.4.16]
Archive-directory: /pub/tools
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)

A while back I asked if anyone had an application that retrieved the
cisco IP Accounting table via SNMP, preferably using the CMU SNMP
package. The only response I got was from Carl Rigney (cdr@brahms.AMD.COM)
who had written a Perl script to parse the output of the CMU snmpwalk 
command.

I decided to do it myself and this is the result:

gwacc [-c] [-n] [-d] <router> <community>

	Retrieve the cisco specific IP accounting table from the specified
	router. -c says get the checkpoint accounting table. -n says don't
	translate IP addresses into names. -d says dump the SNMP packets in hex.

**WARNINGS**

	-c does not work with release 8.0(13) of the cisco gateway server code.
	If the checkpoint IP accounting table has not been created (ie. a 
	CLEAR IP ACCOUNTING command has not been given) it will crash routers
	running 8.1(19) of the cisco gateway server code (to be fixed in the 
	next maintenance release of 8.1).

The output looks like this ...

Source                    Destination                     Packets  Bytes
16.1.0.1                  129.78.64.1                          4     284
16.1.0.1                  129.78.64.2                          1      71
16.1.0.2                  129.78.64.1                          3     213
16.1.0.2                  129.78.64.2                          1      71
16.1.240.23               129.78.64.1                          7     483
18.87.0.28                129.78.64.1                          1      71
139.130.116.2             129.78.64.5                          1     348

	:

192.43.207.1              134.148.48.250                       4     320
192.52.195.1              129.78.131.11                        8     560
192.52.195.1              130.155.128.8                       12     812
192.52.195.10             129.78.64.1                          4     554
192.52.195.10             129.78.64.2                          1     151
192.52.195.10             134.148.16.240                       2     248
192.67.67.53              129.78.64.1                          2     266
192.67.67.53              134.148.4.2                          6     765


The source code is available via anonymous ftp from aarnet.edu.au (130.56.4.16)
as file pub/tools/gwacc.c. You will need the CMU SNMP libraries to compile
it (available from lancaster.andrew.cmu.edu - 128.2.13.21).

I would appreciate it if someone could make this available for ftp in the US 
rather than everyone beating up our overloaded satellite link (assuming they think
it's worth having :-),

Peter Elford,                           	e-mail: P.Elford@aarnet.edu.au
Network Co-ordinator,	 			phone: +61 6 249 3542
Australian Academic Research Network,		fax: +61 6 247 3425
c/o, Computer Services Centre,			post: PO Box 4
Australian National University			      Canberra 2601
Canberra, AUSTRALIA