diff options
author | Peter Palfrader <peter@palfrader.org> | 2012-02-02 16:54:57 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2012-02-02 16:54:57 +0000 |
commit | ab046c6a3f28ed7816bd779fb9442bf45d1510be (patch) | |
tree | 349b6c61ec282505c3ebb0edb80465708fc8552e | |
parent | 1d4f037c886ba7d895e8f3fbba0377d35a2168ec (diff) |
quiet mode for nagios-check-rdiff-backup
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@496 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | nagios-check-rdiff-backup | 7 |
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) |