prometheus: backup time in hours

This commit is contained in:
Christophe Siraut 2020-11-12 15:42:06 +01:00
parent eaaf15201e
commit 9dd90f7af9
1 changed files with 1 additions and 1 deletions

View File

@ -140,7 +140,7 @@ def postgresql(ctn):
if not backup_files:
return -1
created = os.stat(backup_files.sort(key=os.path.getmtime)[-1]).st_ctime
return((datetime.datetime.now() - datetime.datetime.fromtimestamp(created)).days())
return((datetime.datetime.now() - datetime.datetime.fromtimestamp(created)).hours())
recovery = glob.glob("/var/lib/postgresql/*/*/recovery.conf")
if len(recovery) == 0: