dsa-check-dabackup: add command-line options to override limits
authorRaphael Hertzog <hertzog@debian.org>
Wed, 8 Apr 2009 08:04:47 +0000 (08:04 +0000)
committerRaphael Hertzog <hertzog@debian.org>
Wed, 8 Apr 2009 08:09:43 +0000 (08:09 +0000)
Alioth has a backup module that takes 30 minutes in the
rsync "building file list" stage and during this period the file
is not modified and the check should fallback on the previous log
file. The $TOO_FRESH value is too low for us.

dsa-nagios-checks/checks/dsa-check-dabackup

index f400023..6ce30b2 100755 (executable)
@@ -60,7 +60,7 @@ sub help($$) {
        my ($exitcode, $fd) = @_;
        version ($fd, 0);
        print $fd "Usage: $PROGRAM_NAME --help\n";
-       print $fd "Usage: $PROGRAM_NAME";
+       print $fd "Usage: $PROGRAM_NAME [--fresh <minseconds>] [--maxage <seconds>]";
        exit $exitcode
 };
 
@@ -69,6 +69,8 @@ my $params = {};
 Getopt::Long::config('bundling');
 if (!GetOptions (
        'h|help'        =>  \$params->{'help'},
+        'f|fresh=i'    =>  \$TOO_FRESH,
+        'm|maxage=i'    =>  \$MAX_AGE,
        )) {
        die ("$PROGRAM_NAME: Usage: $PROGRAM_NAME [-fwhv]\n");
 };