From f62b4bd52da89a58d87a32e5b058b67e60815985 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 28 Feb 2017 08:42:58 +0100 Subject: [PATCH] dsa-check-backuppg: warn if backups for a database configured in dsa-check-backuppg.conf are missing entirely. --- dsa-nagios-checks/checks/dsa-check-backuppg | 6 +++++- dsa-nagios-checks/debian/changelog | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dsa-nagios-checks/checks/dsa-check-backuppg b/dsa-nagios-checks/checks/dsa-check-backuppg index e8a8592..14baf58 100755 --- a/dsa-nagios-checks/checks/dsa-check-backuppg +++ b/dsa-nagios-checks/checks/dsa-check-backuppg @@ -173,7 +173,7 @@ for dir in os.listdir('.'): files.sort() - unhandled_backups = copy.copy(config['backups'][dir]) + notyetseen_dbs = copy.copy(config['backups'][dir]) ignored_dbs = {} backup_state = {} @@ -246,6 +246,7 @@ for dir in os.listdir('.'): else: note_warning_db(dir, db, 'MISSING-BASE', basefn) continue + if db in notyetseen_dbs: del notyetseen_dbs[db] files.remove(basefn) if backup_state[db]['can_expire_next']: backup_state[db]['expires'].append(baseffn) @@ -327,6 +328,9 @@ for dir in os.listdir('.'): for f in backup_state[db]['expires']: global_expires.append(f) + for db in notyetseen_dbs: + note_warning_db(dir, db, 'NO-BACKUP', 'no backups! (no .backup files found)') + #if not db in backup_state: # note_warning('BASE-WITHOUT-WAL', ffn) # ignored_dbs[db] = True diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index ce5abd2..3ff5d12 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -1,6 +1,8 @@ dsa-nagios-checks (110) UNRELEASED; urgency=medium * dsa-check-timedatectl: handle n/a in timedatectl output for RTC. + * dsa-check-backuppg: warn if backups for a database configured in + dsa-check-backuppg.conf are missing entirely. -- Peter Palfrader Mon, 23 Jan 2017 14:14:06 +0100 -- 2.20.1