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:
2026-03-12 22:24:02 +01:00
parent 0beef6fa48
commit 7495ebcd78
6 changed files with 3 additions and 32 deletions

View File

@@ -19,13 +19,6 @@ trap 'release_lock "$SCRIPT_NAME"' EXIT
log_message "$SCRIPT_NAME" "Starting log segment check..."
# Check if hdbsql is available
if [ ! -x "$HDBSQL_PATH" ]; then
log_message "$SCRIPT_NAME" "ERROR: hdbsql not found or not executable at ${HDBSQL_PATH}"
send_alert "$SCRIPT_NAME" "HANA Monitor Error" "hdbsql not found or not executable at ${HDBSQL_PATH}"
exit 1
fi
# SQL Query for log segments
SQL_QUERY="SELECT b.host, b.service_name, a.state, count(*) FROM PUBLIC.M_LOG_SEGMENTS a JOIN PUBLIC.M_SERVICES b ON (a.host = b.host AND a.port = b.port) GROUP BY b.host, b.service_name, a.state;"