update monitor, sapcontrol as configurable path
This commit is contained in:
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user