A small Python script that checks if your home or web services are up and sends Pushover notifications if they go down or come back up.
It will monitor anything with a URL and a HTTP server - all of which can be configured in the .env file.
It checks every 5 minutes and won't spam you during sleep hours (1 AM – 7 AM).
- Makes HTTP requests to each service to see if they respond.
- Tracks whether each service was previously up or down to avoid duplicate alerts.
- Sends notifications using Pushover API if a service goes down or comes back up.
Logs are written to service_monitor.log and rotated daily, with 7 days kept as default.
- Clone this repo:
git clone https://github.com/yourusername/pingcheck.git
cd pingcheck- Install dependencies:
pip install -r requirements.txt- Edit
.env.examplewith your parameters and rename to.env:
SERVICE_URL=http://your.service.url:port/subpage/
PUSHOVER_API_TOKEN=yourpushovertoken
PUSHOVER_USER_KEY=yourpushoveruserkey- Edit
pingcheck.pyto add new services or configure quiet hours.
All user-configurable parameters are defined in the ## USER-DEFINED VARIABLES ## block.
Adding a new service is simple:
- Create the service URL under ## SERVICE URLS ## section at the top of the script using the provided example
- Add the service to the services dictionary in the main loop section of the script using the provided example
- Voila! Your service is now being monitored.
Run directly:
python pingcheck.pyIt will keep running, checking every 5 minutes.
You can run PingCheck in a Docker container for easy, isolated deployment.
-
Build the Docker image:
docker build -t pingcheck . -
Run the container:
Make sure you have a
.envfile in the project root as described in the Configuration section.docker run -d --name pingcheck-container --env-file .env pingcheck
MIT - do whatever you want, just don’t blame me if it breaks your notifications at 3 AM.
- Add Telegram/Discord notifications as optional.
- Configurable sleep hours via
.env. - Config GUI/TUI
If you find it useful, chuck me a star.