From e653ff7b9a80b393ae2e4409e9f2359c3b6ad7bc Mon Sep 17 00:00:00 2001 From: Tomi Eckert Date: Thu, 12 Mar 2026 22:35:54 +0100 Subject: [PATCH] fix(monitoring): allow sapcontrol exit code 3 The sapcontrol command returns exit code 3 for successful execution in this context. Previously, only exit code 0 was accepted, causing false error alerts and script termination when the process was healthy. --- hana_processes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hana_processes.sh b/hana_processes.sh index 6220ea5..c26ec3d 100644 --- a/hana_processes.sh +++ b/hana_processes.sh @@ -23,7 +23,7 @@ log_message "$SCRIPT_NAME" "Starting HANA process status check..." process_list=$(su - "$HANA_USER" -c "sapcontrol -nr ${HANA_INSTANCE_NR} -function GetProcessList" 2>&1) sapcontrol_status=$? -if [ $sapcontrol_status -ne 0 ]; then +if [ $sapcontrol_status -ne 3 ]; then log_message "$SCRIPT_NAME" "ERROR: sapcontrol command failed with exit code ${sapcontrol_status}" send_alert "$SCRIPT_NAME" "HANA Monitor Error" "sapcontrol command failed. Exit code: ${sapcontrol_status}" exit 1