projects
/
mirror
/
dsa-nagios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nfs-client, autofs on mekeel
[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
0ce4d95
..
78b3380
100755
(executable)
--- a/
dsa-nagios-checks/checks/dsa-check-backuppg
+++ b/
dsa-nagios-checks/checks/dsa-check-backuppg
@@
-47,6
+47,7
@@
import copy
import time
import re
import os
import time
import re
import os
+import errno
import sys
import yaml
import optparse
import sys
import yaml
import optparse
@@
-143,7
+144,15
@@
for dir in os.listdir('.'):
continue
if not os.path.isdir(dir):
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)
note_info('IGNORED', dir)
else:
note_warning('NOT-A-DIR', dir)
@@
-219,8
+228,11
@@
for dir in os.listdir('.'):
basefn = '%s.BASE.%s-%s.tar.gz'%(db, info['label'], info['start wal location'].split(' ',2)[0].replace('/', '_'))
baseffn = os.path.join(dir, basefn)
if not basefn in files:
basefn = '%s.BASE.%s-%s.tar.gz'%(db, info['label'], info['start wal location'].split(' ',2)[0].replace('/', '_'))
baseffn = os.path.join(dir, basefn)
if not basefn in files:
- note_warning_db(dir, db, 'MISSING-BASE', basefn)
- continue
+ basefn = '%s.BASE.%s.tar.gz'%(db, info['label'])
+ baseffn = os.path.join(dir, basefn)
+ if not basefn in files:
+ note_warning_db(dir, db, 'MISSING-BASE', basefn)
+ continue
files.remove(basefn)
if backup_state[db]['can_expire_next']:
backup_state[db]['expires'].append(baseffn)
files.remove(basefn)
if backup_state[db]['can_expire_next']:
backup_state[db]['expires'].append(baseffn)