summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnagios-check-rdiff-backup7
1 files changed, 5 insertions, 2 deletions
diff --git a/nagios-check-rdiff-backup b/nagios-check-rdiff-backup
index 7df30af..1f8b30b 100755
--- a/nagios-check-rdiff-backup
+++ b/nagios-check-rdiff-backup
@@ -32,6 +32,8 @@ import glob
parser = optparse.OptionParser()
parser.set_usage("%prog [options] <backuprepository>")
+parser.add_option("-q", "--quiet", dest="quiet", default=False, action="store_true",
+ help="Silent mode (exit code only)")
parser.add_option("-w", "--warn", metavar="AGE", dest="warn",
help="Warn if backup older than (default: 28h)")
parser.add_option("-c", "--critical", metavar="AGE", dest="critical",
@@ -146,6 +148,7 @@ keys.sort(reverse=True)
for code in keys:
prefix = code_to_prefix(code)
report.append( prefix + ', '.join(backup_per_code[code]) )
-print '; '.join(report)
-for l in log: print l
+if not options.quiet:
+ print '; '.join(report)
+ for l in log: print l
sys.exit(exitcode)