Files
Scripts/monitor/monitor.conf
Tomi Eckert bb0531aeea feat(monitor): Add HANA statement queue monitoring
This commit introduces a new feature to monitor the HANA statement queue.

Added STATEMENT_QUEUE_THRESHOLD and STATEMENT_QUEUE_CONSECUTIVE_RUNS to monitor/monitor.conf.
Implemented logic in monitor/monitor.sh to query the statement queue length, track consecutive breaches of the defined threshold, and send notifications.
Updated the script version to 1.3.0.
Refactored log segment checks to only run when segments are found.
2025-10-01 13:10:57 +02:00

40 lines
1.4 KiB
Plaintext

# Configuration for SAP HANA Monitoring Script
# --- Company Information ---
# Used to identify which company the alert is for.
COMPANY_NAME="Company"
# --- Notification Settings ---
# Your ntfy.sh topic URL
NTFY_TOPIC_URL="https://ntfy.technopunk.space/sap"
# Your ntfy.sh bearer token (if required)
NTFY_TOKEN="tk_xxxxx"
# --- 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
HANA_USER_KEY="CRONKEY"
# HANA Instance Number for sapcontrol
HANA_INSTANCE_NR="00"
# --- Monitoring Thresholds ---
# Disk usage percentage that triggers an alert
DISK_USAGE_THRESHOLD=80
# Percentage of 'Truncated' log segments that triggers an alert
TRUNCATED_PERCENTAGE_THRESHOLD=50
# Percentage of 'Free' log segments below which an alert is triggered
FREE_PERCENTAGE_THRESHOLD=25
# Maximum age of the last successful full data backup in hours.
BACKUP_THRESHOLD_HOURS=25
# Statement queue length that triggers a check
STATEMENT_QUEUE_THRESHOLD=100
# Number of consecutive runs the queue must be over threshold to trigger an alert
STATEMENT_QUEUE_CONSECUTIVE_RUNS=3
# --- Monitored Directories ---
# List of directories to check for disk usage (space-separated)
DIRECTORIES_TO_MONITOR=("/hana/log" "/hana/shared" "/hana/data" "/usr/sap")