This script monitors a list of URLs, checking if they are reachable. If a URL fails 5 times, a notification is sent to a Discord webhook.
- Checks HTTP/HTTPS URLs for reachability.
- Can verify if a specific keyword exists on the page.
- Alerts are sent to different Discord webhooks per URL.
- Configured via a
.credo
file. - Runs automatically via
crontab
on a Raspberry Pi.
On a Raspberry Pi, run:
sudo apt update
sudo apt install python3 python3-pip -y
pip install requests beautifulsoup4 urllib3
git clone https://github.com/bjoerrrn/monitor-urls
cd monitor-urls
Open monitor_urls.credo (needs to be in the same folder as the script) and set:
# Description URL Webhook_URL Optional_Keyword
"test" http://... https://... "test"
Manual Execution
python3 monitor_urls.py
Run Every Minute with Crontab
crontab -e
Add the following line at the bottom:
* * * * * /usr/bin/python3 /home/pi/monitor-urls/monitor_urls.py
Save and exit.
📢 Discord Notifications
❌ {url} DOWN" → Sent when URL is unreachable.
⚠️ {url} MISSING '{keyword}'" → Sent when keyword check fails.
✅ {url} UP" → Sent when a previously failing URL recovers.
Feel free to open issues or pull requests to improve the script! 🚀
if you want to contact me directly, feel free to do so via discord: https://discordapp.com/users/371404709262786561
This project is open-source under the GPL-3.0 License.