[csw-devel] SF.net SVN: opencsw:[655] mirror/check-zpool
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Tue Feb 19 10:35:36 CET 2013
Revision: 655
http://opencsw.svn.sourceforge.net/opencsw/?rev=655&view=rev
Author: dmichelsen
Date: 2013-02-19 09:35:35 +0000 (Tue, 19 Feb 2013)
Log Message:
-----------
check-zpool: Initial scrub is considered ok when specifying max scrub age
Modified Paths:
--------------
mirror/check-zpool
Modified: mirror/check-zpool
===================================================================
--- mirror/check-zpool 2013-02-18 10:11:33 UTC (rev 654)
+++ mirror/check-zpool 2013-02-19 09:35:35 UTC (rev 655)
@@ -163,8 +163,9 @@
# Warn if scrub takes longer then -D <duration>
my $since = $p->scrub_in_progress;
+ my $scrub_duration;
if( $since ) {
- my $scrub_duration = $fmt->format_duration( DateTime->now->subtract_datetime( $since ), significant_units => 2 );
+ $scrub_duration = $fmt->format_duration( DateTime->now->subtract_datetime( $since ), significant_units => 2 );
if( $sd ) {
my $should_have_finished = $since->clone()->add( seconds => $sd );
if( DateTime->compare( DateTime->now, $should_have_finished ) > 0 ) {
@@ -193,9 +194,13 @@
}
} else {
if( $sa ) {
- $np->nagios_exit( WARNING, "Scrub for the pool '$poolname' was never run"
- . ' but must not be older than ' . $sat
- );
+ if( $since ) {
+ push @status, "pool '$poolname' is scrubbed for the first time for $scrub_duration";
+ } else {
+ $np->nagios_exit( WARNING, "Scrub for the pool '$poolname' was never run"
+ . ' but must not be older than ' . $sat
+ );
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list