Skip to content

charlesl46/gotify-livechecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gotify-livechecker

gotify-livechecker is a simple script that checks whether a list of websites is online (responding with the expected HTTP status code), and sends a notification via Gotify if any of them are down.

Features

  • Reads a list of websites to check from a JSON configuration file
  • Supports custom expected HTTP response codes for each site
  • Sends a push notification to a Gotify instance if one or more websites are unreachable or down

Minimal configuration

Create a JSON file with the following structure :

{
  "websites": [
    "https://my.awesome.website.com",
    "another.web.site" // will default to https if no protocol is defined
  ],
  "gotify_url": "https://gotify.mydomain.com",
  "gotify_token": "my-gotify-token",
}

Installation

You can run the script directly if Python and the dependencies are installed. You’ll need:

  • requests
  • gotify (Python client, must be installed or created)

Install dependencies with:

pip install requests gotify

Usage

Run the checker script with your configuration file as an argument:

python checker.py my_config.json

If any of the websites return a different HTTP status code than expected, a notification will be sent via your Gotify instance. You can then put this script in a cron task to check your sites every 10 minutes for example.

Notes

By default, the expected status code is 200, in case you'd expect any other code, you can add it to the conf file as follows :

    "expected_code" : {
        "another.web.site" : 401 // behind an authwall
    }

You can also custom the format of the message you want to send :

    "notification_title" : "Websites are down",
    "notification_format" : "The websites {} are down, panic !!"

About

A server live checker which can send you gotify notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages