Files
the_order/scripts/deploy/phase13-monitoring.sh
T

41 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
#
# Phase 13: Monitoring & Observability
# Verify the Phoenix-native runtime is producing healthy service and journald signals.
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/config.sh"
log_info "=========================================="
log_info "Phase 13: Monitoring & Observability"
log_info "=========================================="
check_proxmox_access
log_step "13.1 Verifying service status inside the Order CT..."
ssh ${SSH_OPTS} "${PROXMOX_SSH_USER}@${ORDER_PORTAL_PUBLIC_HOST}" \
"pct exec ${ORDER_PORTAL_PUBLIC_VMID} -- systemctl is-active ${ORDER_PORTAL_PUBLIC_SERVICE}" \
&& log_success "The Order portal service is active" \
|| log_warning "The Order portal service is not active"
log_step "13.2 Showing recent journald entries..."
ssh ${SSH_OPTS} "${PROXMOX_SSH_USER}@${ORDER_PORTAL_PUBLIC_HOST}" \
"pct exec ${ORDER_PORTAL_PUBLIC_VMID} -- journalctl -u ${ORDER_PORTAL_PUBLIC_SERVICE} -n 20 --no-pager" \
|| log_warning "Unable to fetch recent journald entries"
log_info "Monitoring configuration complete"
log_info "Next steps (manual):"
log_info " 1. Add the CT service to your central log shipping path if desired"
log_info " 2. Add synthetic checks for ${THE_ORDER_PUBLIC_URL}/api/health"
log_info " 3. Keep Phoenix public health in the shared external monitor set"
# Save state
save_state "phase13" "complete"
log_success "=========================================="
log_success "Phase 13: Monitoring & Observability - COMPLETE"
log_success "=========================================="