projects
/
mirror
/
dsa-nagios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do apt checks on squeeze now
[mirror/dsa-nagios.git]
/
dsa-nagios-checks
/
checks
/
dsa-check-backuppg
diff --git
a/dsa-nagios-checks/checks/dsa-check-backuppg
b/dsa-nagios-checks/checks/dsa-check-backuppg
index
83f54ba
..
92ce6cb
100755
(executable)
--- a/
dsa-nagios-checks/checks/dsa-check-backuppg
+++ b/
dsa-nagios-checks/checks/dsa-check-backuppg
@@
-266,18
+266,18
@@
for dir in os.listdir('.'):
for db in backup_state:
if not 'newest-base' in backup_state[db]:
for db in backup_state:
if not 'newest-base' in backup_state[db]:
- note_warning(dir, db, 'NO-BASE', 'no base backup found?')
+ note_warning
_db
(dir, db, 'NO-BASE', 'no base backup found?')
else:
age = time.time() - os.stat(backup_state[db]['newest-base']).st_mtime
if age > config['warn-age']['base']:
else:
age = time.time() - os.stat(backup_state[db]['newest-base']).st_mtime
if age > config['warn-age']['base']:
- note_warning(dir, db, 'BASE-IS-OLD', 'latest base backup is too old')
+ note_warning
_db
(dir, db, 'BASE-IS-OLD', 'latest base backup is too old')
if not 'newest-wal-file' in backup_state[db]:
if not 'newest-wal-file' in backup_state[db]:
- note_warning(dir, db, 'NO-BASE', 'no WAL files found?')
+ note_warning
_db
(dir, db, 'NO-BASE', 'no WAL files found?')
else:
age = time.time() - os.stat(backup_state[db]['newest-wal-file']).st_mtime
if age > config['warn-age']['wal']:
else:
age = time.time() - os.stat(backup_state[db]['newest-wal-file']).st_mtime
if age > config['warn-age']['wal']:
- note_warning(dir, db, 'WAL-IS-OLD', 'latest wal file is too old')
+ note_warning
_db
(dir, db, 'WAL-IS-OLD', 'latest wal file is too old')
for db in backup_state:
if len(backup_state[db]['expires']) > 0:
for db in backup_state:
if len(backup_state[db]['expires']) > 0:
@@
-311,7
+311,8
@@
if options.expire:
if len(problems_seq) > 0:
sys.exit(1)
if len(problems_seq) > 0:
sys.exit(1)
-print "OK: no problems detected"
+if not options.expire or options.verbose:
+ print "OK: no problems detected"
sys.exit(0)
# vim:set et:
sys.exit(0)
# vim:set et: