From 1d418a1e3a12e103ca9d455e54551caf1ace6cd8 Mon Sep 17 00:00:00 2001 From: Kael Shipman Date: Sun, 18 Nov 2018 18:08:44 -0600 Subject: [PATCH] Added check for logfile existence at top of loop --- plugins/logs/service_events | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/logs/service_events b/plugins/logs/service_events index a4dbba76..3f08b88a 100755 --- a/plugins/logs/service_events +++ b/plugins/logs/service_events @@ -329,6 +329,13 @@ function fetch() { continue fi + # Make sure the logfile exists + if [ ! -e "$logfile" ]; then + >&2 echo "Logfile '$logfile' doesn't exist. Skipping." + n=$((n+1)) + continue + fi + # Find which service this logfile is associated with service= while read -u 4 -r svc; do