X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fchecks%2Fdsa-check-backuppg;h=ce6a9a0efacb470d4aa96d4bb108e66c7fb51934;hb=2fa1a6e542f4cc81d5eafcb89856a25fdee94d16;hp=8704f3cef13852902fea923a28608d1fb3cd800e;hpb=c1d628537964b15afc87b04c23275ebd2bdc8888;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/checks/dsa-check-backuppg b/dsa-nagios-checks/checks/dsa-check-backuppg index 8704f3c..ce6a9a0 100755 --- a/dsa-nagios-checks/checks/dsa-check-backuppg +++ b/dsa-nagios-checks/checks/dsa-check-backuppg @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # Copyright 2010 Peter Palfrader # @@ -102,10 +102,7 @@ def wal_pre(w, host, db): (w1,w2) = w if w2 == 0: w1 -= 1 - if (host,db) in ( ('moszumanska', 'main'), ): - w2 = 0xFE - else: - w2 = 0xFF + w2 = 0xFF else: w2 -= 1 @@ -162,7 +159,7 @@ config = load_conf(options.conffile) os.chdir(config['rootdir']) for dir in os.listdir('.'): - if dir.startswith('.') or dir.endswith('.old'): + if dir.startswith('.') or dir.endswith('.old') or dir == 'lost+found': note_info('IGNORED', dir) continue @@ -364,21 +361,21 @@ for dir in os.listdir('.'): for p in problems_seq: - print p + print(p) if options.verbose: for p in notices_seq: - print p + print(p) if options.expire: for f in global_expires: - if options.verbose: print "Expiring %s"%(f) + if options.verbose: print("Expiring %s" % f) if not options.dry_run: os.unlink(f) if len(problems_seq) > 0: sys.exit(1) if not options.expire or options.verbose: - print "OK: no problems detected" + print("OK: no problems detected") sys.exit(0) # vim:set et: