From d27b9f4204b069ef3290070567b54b45a4a3d0d5 Mon Sep 17 00:00:00 2001 From: ssieber Date: Wed, 3 May 2023 17:24:37 +0200 Subject: [PATCH] check_keepalived: Add 2nd stat file location --- check_keepalived/check_keepalived | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/check_keepalived/check_keepalived b/check_keepalived/check_keepalived index c0e14f0..5f34b29 100644 --- a/check_keepalived/check_keepalived +++ b/check_keepalived/check_keepalived @@ -81,7 +81,7 @@ while [ "$1" != "" ]; do done # Config and commands -STAT_FILE='/tmp/keepalived.status' +STAT_FILE='/var/run/keepalived.status' PID_FILE='/run/keepalived.pid' PID=$("${CAT}" "${PID_FILE}" 2>/dev/null) SERVICE=$("${PG}" keepalived) @@ -92,8 +92,13 @@ CHECK_HAIP2=$("${IP}" 2>/dev/null addr sh "${IFACE2}" | "${GREP}" "${HAIP2}" | " # Check files are valid if [ ! -e "${STAT_FILE}" ] then - echo "CRITICAL: Generated status file is missing. State could not be determined." - exit "${CRITICAL}" + if [ -e /tmp/keepalived.status ] + then + STAT_FILE='/tmp/keepalived.status' + else + echo "CRITICAL: Generated status file is missing. State could not be determined." + exit "${CRITICAL}" + fi fi FILE_CONT=$("${CAT}" "${STAT_FILE}" 2>/dev/null)