Code

fix spelling
[rrdtool-all.git] / contrib / snmpstats / README
1 SNMPstats.pl is a moderately simple and quick perl SNMP poller for simple
2 interface traffic and other counters. It's written with flexible and easy
3 hacking in mind, and is commented appropriately.
5 It requires Net::SNMP version 2, available from CPAN.
7 For the sake of simplicity, device names, IPs, and SNMP read strings are
8 hard coded, but this can be easily substituted with something more
9 dynamic. Structure for the devices hash is:
11 $devices{<Canonical device name>}{'ip_address'} = <target ip address>
12                                  {'snmp_read'}  = <SNMP read community>
14 SNMP objects are stored in %oids. SNMP objects polled during device sweeps
15 are stored in @poll_int, using named references to the object names used
16 as key variables in %oids.
18 Interface stats are only collected for interfaces that have an
19 ifAdminStatus of 1. This cuts down on SNMP load quite a bit, given devices
20 are properly managed. Your mileage will vary based on device policies.
22 RRDs are only created for interfaces with ifAdminStatus of 1. This gives
23 you some amount of scale control. Interfaces are checked for an existing
24 RRD on each collection pass, and RRDs created as needed. They are NOT
25 removed if you admin down an interface, so stale RRD cleanup is your
26 problem.
28 One caveat to note is that RRDs are created with upper limits based on
29 ifSpeed. For autosensing 10/100 switches, this is a problem. In an effort
30 to keep this utility simple, I formally declare it to be 'your
31 problem'.
33 This utility runs as a recurring loop, so it's meant to be run in the
34 background like a daemon. You can strip the while/sleep sets and stuff it
35 in cron, if you're so inclined. YMMV. 
37 The script itself is heavily commented, explaining what I do as I go. Be a
38 good user, read the code before you run it. It's simple and
39 straightforward, and it's a good idea to understand how it works,
40 especially if you're a novice user.
42 Bill Nash
43 billn@billn.net / billn@gblx.net