A tool to monitor servers and keep 'em alive by periodically pinging them. This tool is useful for monitoring servers like repl.it projects and also has notifications built-in. Discord webhooks currently supported.
Currently, there are two ways to setup and run keepalive-service
:
The following sections describe how to use both approaches.
Clone the repo:
git clone https://github.com/madhavarshney/keepalive-service
cd keepalive-service
Install Python 3 and pip, and then install the required packages:
python3 -m pip install -r requirements.txt
Create a file called config.yaml
with your configuration (see below) and then start the monitoring script:
python3 -m keepalive
This service can also be run as a docker container. Prebuilt images are available at ghcr.io/madhavarshney/keepalive-service. The config file should be bind-mounted as a volume to /keepalive-service/config.yaml
, and --init
should be enabled.
Running with Docker:
docker run --init \
-v "$(pwd)"/config.yaml:/keepalive-service/config.yaml \
ghcr.io/madhavarshney/keepalive-service:latest
Using Docker Compose:
version: "3.9"
services:
keepalive:
image: ghcr.io/madhavarshney/keepalive-service:latest
restart: always
init: true
volumes:
- ./config.yaml:/keepalive-service/config.yaml:ro
The configuration file config.yaml
should follow the following format:
# Time in seconds to recheck the services
interval: 60
# Discord Webhook URL to send notifications to
discord_webhook_url: https://discordapp.com/api/webhooks/...
# Service definitions
services:
- name: Repl.it HTTP Project
check:
# Check a generic HTTP service hosted on repl.it
# This fetches the specified URL and verifies that the returned content matches "data".
type: REPL_HTTP_SERVICE
url: https://coolnewthing.someone.repl.co
data: Service is working.
- name: My Webpage
check:
# Check a generic webpage with HTML content.
# This verifies that the HTML <title> element matches "data".
type: HTML_TITLE
url: https://webpage.someone.repl.co
data: The Daily News
The MIT License.