Skip to content

runzhammer/webcheck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webcheck

Kleines Go-Monitoring für Rootserver.

Features:

  • HTTP/HTTPS Website Checks
  • TCP Port Checks
  • systemd Service Checks
  • Docker Container Checks
  • Mailversand über lokalen Postfix / SMTP
  • State-Datei, damit nur bei Statuswechseln Mails gesendet werden
  • Recovery-Mail, wenn ein Check wieder UP ist

Build

go build -o webcheck main.go

Installation

sudo mkdir -p /opt/webcheck /var/lib/webcheck
sudo cp webcheck /opt/webcheck/
sudo cp config.example.json /opt/webcheck/config.json
sudo nano /opt/webcheck/config.json

Manueller Test

cd /opt/webcheck
./webcheck -config config.json

Cron, einmal pro Stunde

0 * * * * cd /opt/webcheck && ./webcheck -config config.json >> /var/log/webcheck.log 2>&1

Check-Typen

HTTP/HTTPS

{
  "name": "example.com",
  "type": "http",
  "target": "https://example.com"
}

Erfolgreich ist jeder HTTP-Status von 200 bis 399.

TCP

{
  "name": "SMTP lokal",
  "type": "tcp",
  "target": "127.0.0.1:25"
}

systemd Service

{
  "name": "HAProxy systemd",
  "type": "service",
  "target": "haproxy"
}

Intern wird verwendet:

systemctl is-active --quiet haproxy

Docker Container

{
  "name": "Docker Container nextcloud",
  "type": "docker",
  "target": "nextcloud"
}

Intern wird verwendet:

docker inspect --format '{{.State.Running}}' nextcloud

Der User, der den Cronjob ausführt, braucht Zugriff auf Docker.

About

Checks websites for availability

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors