Python 2.7 script to monitor Webserver pages avaiability. Supports SMTP mail alerts avaliable.
- Check avaliabilty of web pages using requests.
- Support SMTP to send alert emails to the admin
- Multiple pages, even fully websites can be monitored by one process.
- The delay time between each check can be easy configured.
- JSON configuration file, user-friendly enough.
- PHPWatchDog/ - Main folder
- PHPWatchDog/PHPWatchDog.cfg - Configuration file
- PHPWatchDog/PHPWatchDog.py - Python script
- PHPWatchDog/PHPWatchDog.log - Log file
- PHPWatchDog/PHPWD.sh - Persistent start on Unix / Linux
The file is JSON formatted. Please read more about JSON if you don't know JSON Syntax.
Configuration File | |
Property name | Description |
---|---|
services | list of addresses of the web pages you want to monitor. Ex: https://github.com |
log | log file path |
delay | delay between each check, it must be expressed in seconds. Ex: 180 /* 3 minutes */ |
smtp | SMTP configuration array ( see below ) |
debug | If "True" debug messages will be prompted on the console. |
SMTP Array description | |
Property name | Description |
---|---|
enable | If "True" alerts emails will be sent to the address(es) specified. |
auth | If "True" Authentication will be enabled. |
user | User for the smtp auth |
psw | Password for the smtp auth |
addr | Address of smtp server |
port | Port of smtp server |
sender_address | The email address from which emails will be sent |
recipient_addresses | Array of addresses to send the email to. If you need to send the email to only one address, use an array with one element. |
subject | The subject of the email |
ssl | If "True" SSL will be enabled. If you're using gmail set it on "True" |
msg | The email message to send to the user. If you want to edit this be careful about the binding values (ex: %s) |
debug | If "True" print libsmtp debug on console. |