X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fchecks%2Fdsa-check-bacula;h=5f5e445348ec921f87a308cb24b7206c493f999c;hb=df7eca9a828317ceeae6d09b127e89ce433497ac;hp=35aade99552e806b3dffe2d56b0b91f00be60bf1;hpb=1abaca55b56fe3e8fe0d5b214072eebd9aa27900;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/checks/dsa-check-bacula b/dsa-nagios-checks/checks/dsa-check-bacula index 35aade9..5f5e445 100755 --- a/dsa-nagios-checks/checks/dsa-check-bacula +++ b/dsa-nagios-checks/checks/dsa-check-bacula @@ -102,7 +102,7 @@ conn = psycopg2.connect(options.db) cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) cursor.execute(query, params) records = cursor.fetchall() -if len(records) == 0: +if len(records) == 0 or records[0][0] is None: print "CRITICAL: No backups of %s/%s."%(host, level) sys.exit(codes['CRITICAL']) elif len(records) > 1: