Simple monitor to watch URLs (HTTP) or ports (TCP, UDP) and update Cachet status.
This repository has been archived on 2021-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Samuel Philipp c0641e8d97
All checks were successful
continuous-integration/drone/push Build is passing
added cachet link
2020-02-27 22:39:51 +01:00
.dockerignore added Dockerfile 2020-02-27 19:04:38 +01:00
.drone.yml minor bug fix 2020-02-27 20:32:42 +01:00
.gitignore added Dockerfile 2020-02-27 19:04:38 +01:00
Dockerfile minor bug fixes 2020-02-27 20:02:03 +01:00
index.js fixed missing cache issue 2020-02-27 20:41:56 +01:00
package-lock.json initial commit 2020-02-26 23:56:42 +01:00
package.json added Dockerfile 2020-02-27 19:04:38 +01:00
README.md added cachet link 2020-02-27 22:39:51 +01:00

cachet-monitor

Build Status Docker Pulls

Simple monitor to watch URLs (HTTP) or ports (TCP, UDP) and update Cachet status.

Configuration

cachet-monitor can monitor a list of services. Therefore it requires to setup all services in ./data/config.json. The id of each service has to match the cachet component id you want to update! You also can specify a custom timeout in seconds for each service.

You also need to specify the interval (cron) your services should be checked. You can use the cron syntax from node-cron. You also have to set offlineTimeUntilMajor which is the offline time in seconds until the state of an offline service turns from partial to major outage. Finally you need to provide the information to your cachet instance (api and token).

Example:

{
	"services": [
		{
			"id": 1,
			"type": "HTTP",
			"url": "https://sp-codes.de",
			"timeout": 60
		},
		{
			"id": 2,
			"type": "TCP",
			"host": "sp-codes.de",
			"port": 443,
			"timeout": 60
		}
	],
	"cron": "0 * * * * *",
	"offlineTimeUntilMajor": 300,
	"api": "https://<cachet-url>/api/v1",
	"token": "<user-token>"
}

Run with docker

You can use the docker image samuelph/cachet-monitor and mount a volume to /monitor/data to persist cache and config:

docker run -v /your/path//monitor/data:/monitor/data samuelph/cachet-monitor

You also can use it in docker-compose.yml:

services:
  monitor:
    image: samuelph/cachet-monitor
    restart: always
    volumes:
      - /home/tux/status/monitor:/monitor/data

Run from source

  1. clone the repo

    git clone https://git.sp-codes.de/samuel-p/cachet-monitor.git
    
  2. install dependencies

    npm install
    
  3. run

    npm run start