version 1.1, 2006/11/07 20:21:19 |
version 1.2, 2006/11/07 20:23:03 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver$ |
# $RedRiver: check_rrd,v 1.1 2006/11/07 20:21:19 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_rrd *** A nagios check for changing averages in rrds |
# check_rrd *** A nagios check for changing averages in rrds |
# |
# |
|
|
my $status = GetOptions( |
my $status = GetOptions( |
"version|V" => \$opt_V, |
"version|V" => \$opt_V, |
"filename|f=s" => \$filename, |
"filename|f=s" => \$filename, |
"rra|r=s" => \@rraz, |
"rra|r=s" => \@rras, |
"warning|w=s" => \$warning, |
"warning|w=s" => \$warning, |
"critical|c=s" => \$critical, |
"critical|c=s" => \$critical, |
); |
); |
|
|
my $start = int( ($end - $TIMES{'ONE_DAY'}) / $resolution) * $resolution; |
my $start = int( ($end - $TIMES{'ONE_DAY'}) / $resolution) * $resolution; |
|
|
my ($first, $step, $names, $data) = RRDs::fetch( |
my ($first, $step, $names, $data) = RRDs::fetch( |
$file, |
$filename, |
'AVERAGE', |
'AVERAGE', |
'-r', $resolution, |
'-r', $resolution, |
'-s', $start, |
'-s', $start, |