Skip to content

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.

License

Notifications You must be signed in to change notification settings

abra5umente/pingcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PingCheck

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).


How it works

  • 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.


Configuration

  1. Clone this repo:
git clone https://github.com/yourusername/pingcheck.git
cd pingcheck
  1. Install dependencies:
pip install -r requirements.txt
  1. Edit .env.example with your parameters and rename to .env:
SERVICE_URL=http://your.service.url:port/subpage/
PUSHOVER_API_TOKEN=yourpushovertoken
PUSHOVER_USER_KEY=yourpushoveruserkey
  1. Edit pingcheck.py to 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:

  1. Create the service URL under ## SERVICE URLS ## section at the top of the script using the provided example
  2. Add the service to the services dictionary in the main loop section of the script using the provided example
  3. Voila! Your service is now being monitored.

Running

Run directly:

python pingcheck.py

It will keep running, checking every 5 minutes.


Running with Docker

You can run PingCheck in a Docker container for easy, isolated deployment.

  1. Build the Docker image:

    docker build -t pingcheck .
  2. Run the container:

    Make sure you have a .env file in the project root as described in the Configuration section.

    docker run -d --name pingcheck-container --env-file .env pingcheck

License

MIT - do whatever you want, just don’t blame me if it breaks your notifications at 3 AM.


To-Do

  • Add Telegram/Discord notifications as optional.
  • Configurable sleep hours via .env.
  • Config GUI/TUI

If you find it useful, chuck me a star.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published