version 1.8, 2007/01/26 15:45:41 |
version 1.9, 2007/04/02 20:11:07 |
|
|
#!/usr/bin/perl -T |
#!/usr/bin/perl -T |
# $RedRiver: check_rrd,v 1.7 2007/01/12 21:56:01 andrew Exp $ |
# $RedRiver: check_rrd,v 1.8 2007/01/26 15:45:41 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_rrd *** A nagios check for changing averages in rrds |
# check_rrd *** A nagios check for changing averages in rrds |
# |
# |
|
|
|
|
%ENV = (); |
%ENV = (); |
|
|
use constant NAGIOS_OUTPUT => 0; |
use constant NAGIOS_OUTPUT => 1; |
|
|
use POSIX; |
use POSIX; |
use lib "/usr/local/libexec/nagios"; |
use lib "/usr/local/libexec/nagios"; |
|
|
@warning = split(/,/,join(',',@warning)); |
@warning = split(/,/,join(',',@warning)); |
|
|
if ($time) { |
if ($time) { |
@time = split /:/, $time; |
@time = split /[:,]/, $time; |
for (0..2) { |
for (0..2) { |
unless ($time[$_]) { |
unless ($time[$_]) { |
die "Time usage needs 3 entries, like 'WEEK:DAY:HOUR'"; |
die "Time usage needs 3 entries, like 'WEEK:DAY:HOUR'"; |
|
|
unless (exists $TIMES{ $time[$_] }) { |
unless (exists $TIMES{ $time[$_] }) { |
die "Times need to be one of WEEK, DAY, HOUR or FIVE_MINUTES"; |
die "Times need to be one of WEEK, DAY, HOUR or FIVE_MINUTES"; |
} |
} |
print $TIMES{ $time[$_] }, "\n"; |
#print $TIMES{ $time[$_] }, "\n"; |
} |
} |
} |
} |
|
|