The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

tinymrtg.pl - Tiny Multi Router Traffic Grapher

SYNOPSIS

    $ tinymrtg.pl [-c COMMUNITY_NAME] [-x REGEXP] HOST [HOST [...]]

    COMMUNITY_NAME ... SNMP Community Name. Omitting uses 'public'.
    REGEXP         ... Specify regular expression for pickup IFs by name.
    HOST           ... Target hosts to check.

    Environment Variables:
    PATH2DATADIR   ... Path to data directry where files are stored.
    URL2HTMLDIR    ... URL which specifys PATH2DATADIR via HTTP service.

    This program is for devices which can deal SNMP version 2c.

DESCRIPTION

With installing Tobias Oetiker's RRDtool and RRD::Simple, this sample will do like MRTG. (It is better to execute this by cron. And note that RRD::Simple creates RRD files with 10 min. intervals when using schema 'mrtg')

If Environmental variables, PATH2DATADIR and URL2HTMLDIR, are defined, files will be stored under PATH2DATADIR and URL pathes will include URL2HTMLDIR in html. Or Modify $datadir and $htmldir to decide these path and URL where browser can access through your http service.

NOTE

This script is a sample of Net::SNMP::Util. This program is for devices which can deal SNMP version 2c.

EXAMPLES

It is better to modify definition of $datadir and $htmldir to your path. Of course, your HTTP service must run already.

The basic way to run this program is like;

    example% tinymrtg.pl -c yes5 dream rouge lemonade mint aqua

It is important to except unnecessary ports (e.g. management port), so use -x option.

    example% tinymrtg.pl -c yes5gogo -r '^\d+/\d+$' milkyrose

I think it is a way to use hosts file for checking devices out of DNS.

    example% tinymrtg.pl -c yes5gogo -r '^\d+/\d+$' \
    `cat /etc/hosts | awk '/\.precure\./{print $2}'`

Its good way to edit crontable to execute this automatically and periodically.

    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/tinymrtg.pl ...

REQUIREMENTS

RRDtool - This sample uses the advantage of RRDtool, RoundRobinDatabase Tool. Net::SNMP,CGI and RRD::Simple.

AUTHOR

t.onodera, <cpan :: garakuta.net>

SEE ALSO

Tobias Oetiker's MRTG - http://oss.oetiker.ch/mrtg/ Tobias Oetiker's RRDtool - http://www.mrtg.org/rrdtool/

Net::SNMP - Core module of Net::SNMP::Util which brings us good SNMP implementations. Net::SNMP::Util::OID - Sub module of Net::SNMP::Util which provides easy and simple functions to treat OID. Net::SNMP::Util::TC - Sub module of Net::SNMP::Util which provides easy and simple functions to treat textual conversion.

LICENSE AND COPYRIGHT

Copyright(C) 2011- Takahiro Ondoera.

This program is free software; you may redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.