version 1.10, 2008/05/24 02:03:23 |
version 1.11, 2008/05/24 14:13:15 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: check_rrd,v 1.9 2007/04/02 19:11:07 andrew Exp $ |
# $RedRiver: check_rrd,v 1.10 2008/05/24 01:03:23 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_rrd *** A nagios check for changing averages in rrds |
# check_rrd *** A nagios check for changing averages in rrds |
# |
# |
|
|
|
|
my $info = RRDs::info($filename) or die "Problem with info from '$filename': $!"; |
my $info = RRDs::info($filename) or die "Problem with info from '$filename': $!"; |
|
|
my $resolution = $info->{'step'} - 5; |
my $resolution = $info->{'step'}; |
my $last = $info->{'last_update'}; |
my $last = $info->{'last_update'}; |
|
|
my $age = time - $last; |
my $age = time - $last; |
|
|
my ($first, $step, $names, $data) = RRDs::fetch( |
my ($first, $step, $names, $data) = RRDs::fetch( |
$filename, |
$filename, |
'AVERAGE', |
'AVERAGE', |
'-r', $resolution, |
'-r', ($resolution / 2), |
'-s', $start, |
'-s', $start, |
'-e', $end |
'-e', $end |
) or die "Problem fetching from '$filename': $!"; |
) or die "Problem fetching from '$filename': $!"; |