1.4 90/06/20

This is a bunch of stuff to read out IP accounting data from CISCO
gateways and some few attempts at processing that data in menaingful
ways. 


	It certainly is not finished nor polished ! 


The data is read and stored in a standard format whioch can be processed
by various scripts.  This format consists of blank separated lines.  The
normal data line has four fields:

	<ip-from> <ip-to> <npackets> <nbytes>

Example:

	192.16.202.1   128.96.128.120   4   272


A line beginning with the word "SAMPLE" separates the different samples
and gives the date and time for the sample represented by the data lines
that follow the SAMPLE line:

	SAMPLE <year> <month> <day> <hour> <minutes> <seconds>

Example:

	SAMPLE 90 04 12 15 00 06


The data can also be stored in a summary form.  Currently one summary
form giving the <NTOP> data lines with the most bytes transferred is
produced.  Lines representing less than
<CUTPCT> percent of the traffic are suppressd. In addition a SUM
line is produced giving the total number of data lines and the sums of
packets and bytes:

	SUM <npairs> <packets> <bytes>

Example:

	SUM 539 75950 15647439



Files in this distribution:

 Makefile		obvious
			This file has all configuration parameters
			(passwords, prompts). Be sure to protect it. 


 ciscotalk.c		simple minded program to talk
			to the cisco console and get information.
			This just ignores the TELNET protocol

 getipacct.sh		Shell script to run periodically (from cron)
			to read out samples. I appends to a file
			containing raw samples and to a file containing
			summaries. Some tuning can be done in the
			file itself. This will be edited into
			getipacct which will actually be run.
			getipacct will contain paswords. so be careful.

 martians.sh		script to detect martian packets in the logging files

 nameipacct.c		translates IP addresses to DNS names
			and makes output more readable

 agg.awk		awk script to do aggregates of sample files

 aggday.awk		day by day aggregation

 sum.awk		do byte and packet sums

 hosts.awk		do sums by hosts


Installation:

- Edit Makefile and set the configuration parameters to apropriate
values for your site. 

- make install

- Try "getipacct" to see if it creates both files and if they contain
what you expect (be sure the cisco concerned has accounting turned on)

- arrange for cron to call getipacct regularly

- arrange for the files to be cleaned up regularly



I am very grateful for comments and more data reducing software.  I am
also interested in generating alarms from the samples in real time. 
Example: This host uses more than 50% of a line! 


Also:
	Maybe a database of what has been used by hosts (perl script with dbm)?
	A perpetual list of hosts that a gateway has ever seen:
		"This gateway has been used by 30.000 hosts last month".

Daniel <dfk@mcsun.eu.net>
