summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-03-22 00:20:38 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-03-22 00:20:38 +0100
commit31e3ea00dc1c8f22af13a3205835a678d269ca77 (patch)
tree33fa11a425a3fce9aa5a98c92cb6de0b3cb3baa2 /roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2
parentch-mod: tempary disable montirong of currently not running nodes (diff)
prometheus: minor fixes and improvements
Diffstat (limited to 'roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2')
-rw-r--r--roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j217
1 files changed, 10 insertions, 7 deletions
diff --git a/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2 b/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2
index aeddc903..b1a78dec 100644
--- a/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2
+++ b/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/deleted-libraries.j2
@@ -30,15 +30,18 @@ def main():
if path not in processes_linking_deleted_libraries:
processes_linking_deleted_libraries[path] = {}
- if library in processes_linking_deleted_libraries[path]:
- processes_linking_deleted_libraries[path][library] += 1
- else:
- processes_linking_deleted_libraries[path][library] = 1
- except EnvironmentError as e:
+ if library in processes_linking_deleted_libraries[path]:
+ processes_linking_deleted_libraries[path][library] += 1
+ else:
+ processes_linking_deleted_libraries[path][library] = 1
+ except FileNotFoundError:
# Ignore non-existent files, since the files may have changed since
# we globbed.
- if e.errno != errno.ENOENT:
- sys.exit('Failed to open file: {0}'.format(path))
+ pass
+ except ProcessLookupError:
+ # If process vanishes while collecting the linked libs reading lines from
+ # the map file yields this error.
+ pass
num_processes_per_library = {}