From: Paul Wise Date: Tue, 27 Jan 2015 17:21:39 +0000 (+0800) Subject: dsa-check-backuppg: Ignore removed tmp files instead of crashing X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-nagios.git;a=commitdiff_plain;h=bfc386f0b11feb1f427d083aa4bfabf319d766f9 dsa-check-backuppg: Ignore removed tmp files instead of crashing --- diff --git a/dsa-nagios-checks/checks/dsa-check-backuppg b/dsa-nagios-checks/checks/dsa-check-backuppg index e7cfd1a..886336f 100755 --- a/dsa-nagios-checks/checks/dsa-check-backuppg +++ b/dsa-nagios-checks/checks/dsa-check-backuppg @@ -143,7 +143,15 @@ for dir in os.listdir('.'): continue if not os.path.isdir(dir): - if min(os.path.getmtime(dir), os.path.getctime(dir)) + 3600*4 > time.time(): + try: + mtime = os.path.getmtime(dir) + ctime = os.path.getctime(dir) + except OSError as e: + if e.errno == errno.ENOENT: + continue + else: + raise e + if min(mtime, ctime) + 3600*4 > time.time(): note_info('IGNORED', dir) else: note_warning('NOT-A-DIR', dir) diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index 7c5c0de..9065611 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -1,7 +1,11 @@ dsa-nagios-checks (105) UNRELEASED; urgency=medium + [ Peter Palfrader ] * dsa-check-dnssec-delegation: Ignore revoked DNSKEYs in zone. + [ Paul Wise ] + * dsa-check-backuppg: Ignore removed tmp files instead of crashing + -- Peter Palfrader Fri, 02 Jan 2015 10:53:43 +0100 dsa-nagios-checks (104) unstable; urgency=medium