BGP — alert when a peer session is down
A BGP session with an upstream / cloud peering drops — half of routes are gone. The peer does not notify you, and your network monitoring (if any) often is not wired to BGP state.
Recipe
#!/usr/bin/env bash
# /etc/cron.d/bgp-session
# */1 * * * * root /opt/bgp-session.sh
# Works with FRRouting (vtysh) — adapt for bird/junos as needed
DOWN=$(vtysh -c 'show bgp summary' \
| awk '/^[0-9]/ && $11 != "Established" {print $1}' \
| tr '\n' ',')
if [ -n "$DOWN" ]; then
curl -fsS "$HEARTBEAT_URL" --data-urlencode "bgp_down=$DOWN"
exit 2
fi
echo "OK (all peers Established)"
Same thing in Enterno.io
Wire to an Enterno heartbeat — learn the peer dropped immediately, and your alert beats the customer-ticket pile-up.
Related recipes
Connection to a database / partner API loses 5–10 % of packets — the app sees timeouts, but `ping -c 4` says 'all good'. TCP retransmits silently chop throughput.
Ensure your site returns 2xx every minute, alert to Slack/Telegram on failure.
Minimal script that checks an SSL certificate and alerts 14 days before expiry.