update monitor, sapcontrol as configurable path

This commit is contained in:
2025-09-24 18:01:59 +02:00
parent db354c6441
commit c800c20f1b
3 changed files with 11 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ NTFY_TOPIC_URL="https://ntfy.technopunk.space/sap"
NTFY_TOKEN="your_ntfy_token_here"
# --- HANA Connection Settings ---
# Full path to the sapcontrol executable
SAPCONTROL_PATH="/usr/sap/NDB/HDB00/exe/sapcontrol"
# Full path to the hdbsql executable
HDBSQL_PATH="/usr/sap/hdbclient/hdbsql"
# HANA user key for authentication

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# Version: 1.0.3
# Version: 1.0.4
# =============================================================================
# SAP HANA Monitoring Script
#
@@ -40,7 +40,13 @@ send_notification() {
# --- HANA Process Status ---
echo "⚙️ Checking HANA process status..."
non_green_processes=$(sapcontrol -nr "${HANA_INSTANCE_NR}" -function GetProcessList | tail -n +6 | grep -v 'GREEN')
if [ ! -x "$SAPCONTROL_PATH" ]; then
echo "❌ Error: sapcontrol not found or not executable at ${SAPCONTROL_PATH}"
send_notification "HANA Monitor Error" "❌ Error: sapcontrol not found or not executable at ${SAPCONTROL_PATH}"
exit 1
fi
non_green_processes=$("${SAPCONTROL_PATH}" -nr "${HANA_INSTANCE_NR}" -function GetProcessList | tail -n +6 | grep -v 'GREEN')
if [ -n "$non_green_processes" ]; then
echo "🚨 Alert: One or more HANA processes are not running!"