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

NAME

  snmpmonRep - Create SNMP-Monitor reports

SYNOPSIS

  snmpmonRep [--config <file>] [--daily] [--debug] [--from <fromtime>]
             [--help] ] [--scale <bytes>] [--to <totime>] [--verbose]
             [--version]

DESCRIPTION

This is a small utility for extracting statistics from an SNMP-Monitor database. It is typically called every month for generating accounting data.

The report generator reads a list of all hosts and interfaces from its config file, by default ~etc_dir~/configuration. For any interface and host it finds, the sums of inoctets, outoctets and the average uptime are computed. Defaults are sent via email to the recipients configured in the config file.

Available options are:

--config <file>

This option forces reading the configuration from <file>. The default config file is ~etc_dir~/configuration.

--daily

By default only total sums are computed. This option will add daily sums to the generated report. Daily sums can slow down the report drastically, because they require grouping and sorting.

--debug

This option suppresses sending reports. Implies verbose mode.

--from <yyyy-mm-dd>

This option is used to set the reports start time. By default the previous month is reported, thus --from defaults to the first day of the previous month. Dates can be in the format yyyy-mm-dd or dd-mm-yyyy. See also the --to option.

--help

Print a usage message and exit with error status.

--scale <bytes>

If your counters exceed Perl's or MySQL's integer limits, you can reduce the reports granularity to avoid overflow of numbers. This is typically required, if the counters exceed 2 GB. Examples:

  --scale=1000

or

  --scale=1024
--to <yyyy-mm-dd>

Similar to --from, setting the reports stop time. This option is used to set the reports start time. By default the previous month is reported, thus --to defaults to the first day of the current month. Dates can be in the format yyyy-mm-dd or dd-mm-yyyy. See also the --from option.

--version

Print version number and exit.

--verbose

Turn on verbose mode, usefull mainly for debugging.

AUTHOR AND COPYRIGHT

This program is Copyright (C) 1998-99 by

    Jochen Wiedmann
    Am Eisteich 9
    72555 Metzingen
    Germany

    Phone: +49 7123 14887
    Email: joe@ispsoft.de

All rights reserved.

You may distribute this program under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

FILES

   ~etcdir~/configuration       Default config file

SEE ALSO

  L<snmpmon(1)>, L<SNMP::Monitor(3)>
EOF

require SNMP::Monitor; my $config = SNMP::Monitor->Configuration('configuration');

require Config; $config->{'startperl'} = $Config::Config{'startperl'}; $config->{'startperl'} = $Config::Config{'startperl'}; # Make -w happy ...

$script =~ s/\~(\w+)\~/$config->{$1}/eg;

if (!open(FILE, ">snmpmonRep") || !print FILE ($script) || !close(FILE)) { die "Error while writing snmpmonRep script: $!"; }