1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

zenus_: Add some debugging

Add a bit of debugging code. Move to positive/negative graphing
This commit is contained in:
Paul Saunders 2012-01-12 12:46:25 +00:00
parent 10b89a6d67
commit 6f0e6960a8

View file

@ -55,13 +55,15 @@ use warnings;
use lib $ENV{'MUNIN_LIBDIR'};
use Munin::Plugin;
use Data::Dump qw(pp);
use Time::Local;
my $ret = undef;
# Load modules like so
if ( !eval "require zenus;" ) {
$ret =
"Could not load zenus. Get it from http://www.rachaelandtom.info/zenus";
"Could not load zenus. Get it from http://www.rachaelandtom.info/zenus\n";
$ret .= "(BTW, \@INC is: " . join( ', ', @INC ) . ")\n";
}
my $USER = $ENV{user};
@ -182,20 +184,26 @@ if ( defined $ARGV[0] and $ARGV[0] eq "config" ) {
my $cap = sprintf( "%.3f", $data->{avail} );
my $warn = sprintf( "%.3f", $cap * 0.25 );
my $crit = sprintf( "%.3f", $cap * 0.1 );
my $datestr = scalar( localtime($lastread) );
print <<EOF;
graph_args --base 1000
graph_vlabel GBytes
graph_vlabel GBytes out (-) / in (+)
graph_category Network
graph_title Zen Broadband Usage
graph_info Usage of your Zen Broadband account: $data->{name}
download.label Downloaded
download.type GAUGE
download.info Amount of data downloaded (Limit is $cap GB)
download.draw AREA
upload.label Uploaded
upload.type GAUGE
upload.info Amount of data uploaded (No upper limit)
upload.draw AREA
upload.graph no
upload.colour 00CC00EE
download.label Transfer
download.type GAUGE
download.info Amount of data downloaded (Limit is $cap GB)
download.draw AREA
download.extinfo Last Read was $datestr
download.negative upload
download.colour 00CC00EE
allowance.label Allowance
allowance.type GAUGE
allowance.info Amount of data you are allowed to download this month
@ -214,7 +222,7 @@ overrate.info Rate at which you're downloading beyond the sustainable rate
overrate.draw LINE1
overrate.min 0
overrate.warning 0:
graph_order download upload allowance remaining overrate
#graph_order download upload allowance remaining overrate
EOF
save_data($data);