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.
This commit is contained in:
@@ -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)
|
process_list=$(su - "$HANA_USER" -c "sapcontrol -nr ${HANA_INSTANCE_NR} -function GetProcessList" 2>&1)
|
||||||
sapcontrol_status=$?
|
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}"
|
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}"
|
send_alert "$SCRIPT_NAME" "HANA Monitor Error" "sapcontrol command failed. Exit code: ${sapcontrol_status}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user