Network Management SNMP assignment 2
Dordal, Spring 2011
Due: April 25
You are to write a program (either in java using the Java SNMP
interface or in a scripting language) that collects the following mib-2
values from every interface of a given host once a minute:
- ifInOctets (for reference; all other values are packet counts)
- ifOutOctets (for reference; all other values are packet counts)
- ifInUcastPkts
- ifOutUcastPkts
- ifInNUcastPkts
- ifOutNUcastPkts
- tcpInSegs
- tcpOutSegs
- udpInDatagrams
- udpOutDatagrams
Because you are gathering data once a minute, you should not use crontab; rather, your program should just sleep.
You should run your program for ~2 hours (1 hour minimum). One way to
arrange this, after you have it working to your satisfaction, is to
start it and have it collect 60-120 lines of output and then exit.
Output should be as tab-separated columns containing the successive differences. Note that differences should work even if a value has wrapped around, on most systems using 32-bit arithmetic.
You should then (as a separate step) give me a graph for the lo and eth0
interfaces of input and output bytes, and then packets in the four
categories NU, tcp, udp and unicast-but-not-tcp-or-udp, by minute.
Note that you will not be collecting entire tables, just selected columns. You will, however, have to figure out what all the interfaces are.
Note also that the TCP and UDP counts above are for all
interfaces. You will need to sum up the ifInUcastPkts values for each
interface to get a comparable number representing all unicast packets
on all interfaces; ditto for ifOutUcastPkts, ifInNUcastPkts,
ifOutNUcastPkts.
You thus really should also add up the ifInOctets for all interfaces, ditto ifOutOctets, if you want to be able to compare.