2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Allows setting warnings by environment variables.

This commit is contained in:
Kris Popendorf 2013-04-23 23:50:58 +09:00
parent d9ab69e0a1
commit b9a08b369a

View File

@ -32,7 +32,7 @@ Please note that aliases cannot be monitored with this plugin.
=head1 VERSION =head1 VERSION
$Id: bandwidth_,v 1.35 2012/01/23 20:04:33 root Exp $ $Id: bandwidth_,v 1.37 2012/01/23 20:04:33 root Exp $
=head1 AUTHOR =head1 AUTHOR
@ -75,6 +75,9 @@ my $count30 = 2592000; # The number of seconds in 30 days
my $unix_ts = time; my $unix_ts = time;
my $rollover = 4294967295; my $rollover = 4294967295;
my $monthlyCap = ($ENV{monthlycap} or 268435456000);
my $warnRate = $monthlyCap/$count30;
init(); init();
sub autoconf { sub autoconf {
@ -177,9 +180,9 @@ monthly.info Your projected monthly network rate based on your average network r
graph_category network graph_category network
graph_args --base 1024 -l 0 graph_args --base 1024 -l 0
graph_info This graph show your current average bandwidth usage and projected 30 day average based on your last 30 day usage. graph_info This graph show your current average bandwidth usage and projected 30 day average based on your last 30 day usage.
average.warning 103563 average.warning $warnRate
monthly.warning 268435456000 monthly.warning $monthlyCap
30dayusage.warning 268435456000 30dayusage.warning $monthlyCap
EOM EOM
exit 0; exit 0;
} }