refactor(monitoring): remove hardcoded tool paths
Remove SAPCONTROL_PATH and HDBSQL_PATH variables from configuration. Update scripts to rely on the system PATH environment variable when executing as the <sid>adm user. Remove redundant existence checks for these commands.
This commit is contained in:
@@ -19,15 +19,8 @@ trap 'release_lock "$SCRIPT_NAME"' EXIT
|
||||
|
||||
log_message "$SCRIPT_NAME" "Starting HANA process status check..."
|
||||
|
||||
# Check if sapcontrol is available
|
||||
if [ ! -x "$SAPCONTROL_PATH" ]; then
|
||||
log_message "$SCRIPT_NAME" "ERROR: sapcontrol not found or not executable at ${SAPCONTROL_PATH}"
|
||||
send_alert "$SCRIPT_NAME" "HANA Monitor Error" "sapcontrol not found or not executable at ${SAPCONTROL_PATH}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get process list
|
||||
process_list=$(su - "$HANA_USER" -c "${SAPCONTROL_PATH} -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=$?
|
||||
|
||||
if [ $sapcontrol_status -ne 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user