Monitoring
bash
Beginner
Uptime Monitor Script
Check HTTP endpoints and alert if they return non-200 or exceed response threshold.
bash
#!/bin/bash
URLs=(https://example.com https://api.example.com/health)
for url in "${URLs[@]}"; do
code=$(curl -s -o /dev/null -w "%{http_code}" $url)
if [ $code != 200 ]; then
echo ALERT: $url returned $code
fi
echo $url $code
done
Prerequisites
- curl
Pro Tips
- → Run every 5 minutes via cron for basic uptime monitoring.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- bash
- Level
- Beginner
- Read time
- 2 min
- Published
- Apr 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
Disk IO Monitor
Monitor per-device disk read/write throughput in real time using iostat.
bash
·
Beginner
Cron Job Heartbeat Monitor
Send a heartbeat ping after each cron job run — alert if a heartbeat is missed.
python
·
Intermediate
Datadog Custom Metric Reporter
Report custom business metrics to Datadog from a Python script via DogStatsD.
python
·
Advanced