Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.1 KiB
Bash
Executable File
34 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Handle Keepalived state changes
|
|
# This script should be deployed to /usr/local/bin/keepalived-notify.sh on Proxmox hosts
|
|
|
|
set -euo pipefail
|
|
|
|
STATE="${1:-unknown}"
|
|
LOGFILE="/var/log/keepalived-notify.log"
|
|
TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
|
|
VIP="${VIP:-192.168.11.166}"
|
|
|
|
# Ensure log directory exists
|
|
mkdir -p "$(dirname "$LOGFILE")"
|
|
|
|
case "$STATE" in
|
|
"master")
|
|
echo "[$TIMESTAMP] Transitioned to MASTER - This node now owns VIP $VIP" >> "$LOGFILE"
|
|
# Optionally: Start services, send alerts, etc.
|
|
# Example: Send alert
|
|
# echo "NPMplus HA: Node $(hostname) is now MASTER" | mail -s "NPMplus HA Master" admin@example.com
|
|
;;
|
|
"backup")
|
|
echo "[$TIMESTAMP] Transitioned to BACKUP - Standby mode" >> "$LOGFILE"
|
|
;;
|
|
"fault")
|
|
echo "[$TIMESTAMP] Transitioned to FAULT - Health check failed" >> "$LOGFILE"
|
|
# Optionally: Send critical alerts
|
|
# echo "NPMplus HA: Node $(hostname) is in FAULT state!" | mail -s "NPMplus HA Fault" admin@example.com
|
|
;;
|
|
*)
|
|
echo "[$TIMESTAMP] Unknown state: $STATE" >> "$LOGFILE"
|
|
;;
|
|
esac
|