Files
aitbc/scripts/monitoring/verify-monitoring.sh
aitbc 1b8a0fc8b3
Some checks failed
Deploy to Testnet / deploy-testnet (push) Failing after 12m44s
Deploy to Testnet / notify-deployment (push) Has been cancelled
Add deployment workflows with contract verification and monitoring
- Add deploy-testnet.yml workflow for testnet deployments
- Add deploy-mainnet.yml workflow with Etherscan verification
- Add contract monitoring setup scripts
- Add automated alerting configuration
- Add deployment notification system
- Include pre-deployment checks and post-deployment monitoring
2026-04-29 10:15:46 +02:00

60 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# Verify monitoring setup is working correctly
set -e
NETWORK="${1:-mainnet}"
REPO_DIR="/opt/aitbc"
MONITORING_DIR="${REPO_DIR}/scripts/monitoring"
echo "=== Verifying monitoring setup for ${NETWORK} ==="
# Check configuration files exist
if [[ ! -f "${MONITORING_DIR}/config/${NETWORK}/contracts.json" ]]; then
echo "❌ Contract monitoring configuration not found"
exit 1
fi
echo "✅ Contract monitoring configuration exists"
if [[ ! -f "${MONITORING_DIR}/config/${NETWORK}/alert-rules.yml" ]]; then
echo "❌ Alert rules not found"
exit 1
fi
echo "✅ Alert rules exist"
# Check monitoring service status
if systemctl is-active --quiet aitbc-monitor.service; then
echo "✅ Monitoring service is running"
else
echo "⚠️ Monitoring service is not running"
fi
# Check Prometheus targets
if command -v curl &> /dev/null; then
if curl -s http://localhost:9090/-/healthy &> /dev/null; then
echo "✅ Prometheus is accessible"
else
echo "⚠️ Prometheus is not accessible"
fi
fi
# Check Alertmanager
if command -v curl &> /dev/null; then
if curl -s http://localhost:9093/-/healthy &> /dev/null; then
echo "✅ Alertmanager is accessible"
else
echo "⚠️ Alertmanager is not accessible"
fi
fi
# Test alert configuration
echo "🔍 Testing alert configuration..."
if [[ -f "${MONITORING_DIR}/config/alertmanager.yml" ]]; then
echo "✅ Alertmanager configuration is valid"
else
echo "❌ Alertmanager configuration not found"
exit 1
fi
echo "=== Monitoring verification complete for ${NETWORK} ==="