The smallest watchdog on earth. Tiny, monitoring-plugins compatible monitoring with a status page. https://cloud.docker.com/repository/docker/momar/chihuahua/general
 
 
 
 
 
 
Go to file
Phillipp Engelke d04f0d8f41 Merge pull request 'Disable API when PORT=none (fixes #36)' (#60) from feature/port-none into master
Reviewed-on: #60
2021-01-03 16:53:06 +01:00
cmd Fix all syntax errors with the new filter model (filters & config reload are untested) 2021-01-02 17:22:53 +01:00
config Remove "verify" for notifiers again (it's way too complex) 2021-01-03 09:55:49 +01:00
docs make doc clearer 2021-01-03 11:22:33 +01:00
notifiers Add environment variables for command notifier & simplify its log output 2020-12-31 19:38:55 +01:00
resources Show error in plaintext Mails 2020-11-18 10:34:25 +01:00
web Fix API URL in frontend (fixes #39) 2020-01-29 19:37:58 +01:00
.dockerignore Make Docker build correctly, fix #5 (ssh key & default config) & also make checks unknown on startup 2020-01-27 19:48:15 +01:00
.gitignore Fix .gitignore, docs for delay, email sender address & SSH key generation 2020-01-28 18:23:50 +01:00
Dockerfile Make Docker build correctly, fix #5 (ssh key & default config) & also make checks unknown on startup 2020-01-27 19:48:15 +01:00
LICENSE Publish first working public version (1.0) 2019-04-09 19:37:50 +02:00
README.md Fix setup.sh command in README.md & missing SSH keys 2020-02-09 13:45:11 +01:00
api.go Disable API when PORT=none (fixes #36) 2021-01-03 16:50:43 +01:00
check.go Limit maximum delay on startup to ConnectionTimeout * number of checks 2020-11-11 20:54:04 +01:00
chihuahua.service Clean up go.mod, fix chihuahua.service for user services, add support for /etc/chihuahua.rc (#38), fix check_sudo in setup.sh 2020-01-29 19:36:53 +01:00
go.mod Model & document filters for #31 2021-01-02 16:38:07 +01:00
notify.go Remove "verify" for notifiers again (it's way too complex) 2021-01-03 09:55:49 +01:00
types.go Remove "verify" for notifiers again (it's way too complex) 2021-01-03 09:55:49 +01:00

README.md

chihuahua

The smallest watchdog on earth. Tiny, monitoring-plugins compatible monitoring with a status page, built with Go.

  • Run nagios/monitoring-plugins checks on a remote server
  • Alert on state change via Gotify or email
  • Show a nice little status page

Screenshot

Getting Started

docker run -d -p 8080:80 -v "$PWD/data:/data" momar/chihuahua
nano data/chihuahua.hcl

Chihuahua now runs at http://localhost:8080.

You can find a full example configuration file at chihuahua.hcl, and should also read the full configuration manual, but to get started, you can use a simple configuration like this:

check "cpu" {
  # This check will be run on every server, unless the 
  # server specifies an overriding check called "cpu".
  name = "CPU Load"
  command = "check_load -r -w 3,2,1.25 -c 4,3,2"
}

server "server-local" {
  connection = "local"
}

server "server-01" {
  connection = "ssh chihuahua@example.org"
  check "ram" {
    command = "check_memory -w 8 -c 3" # parameters in percent
  }
}

notifier "email-myself" {
  # emails are delayed by 5 minutes by default to accumulate
  # multiple notifications into a single notification email.
  type = "smtp"
  server = "user:password@smtp.example.org"
  from = "Chihuahua <chihuahua@example.org>"
  to = ["myself@example.org"]
}
Use a systemd service to install the server without Docker (unsupported)
wget https://codeberg.org/momar/chihuahua/releases/download/v1.4/chihuahua-x64.gz -O- | gunzip > /tmp/chihuahua
sudo install -m755 /tmp/chihuahua /usr/local/bin/chihuahua

mkdir -p /usr/local/lib/chihuahua/.ssh
useradd -d /usr/local/lib/chihuahua -M -r -s /usr/sbin/nologin chihuahua
ssh-keygen -b 2048 -f /usr/local/lib/chihuahua/.ssh/id_rsa -P "" -C "Chihuahua Monitoring"
nano /etc/chihuahua.yml

sudo wget https://codeberg.org/momar/chihuahua/raw/branch/master/chihuahua.service -O /etc/systemd/system/chihuahua.service
sudo systemctl enable chihuahua.service
sudo systemctl start chihuahua.service

Set up a server for connections (Debian/Ubuntu/Alpine/...)

curl -Ls http://status.example.org:8080/setup.sh | sudo sh

You can now use connection = "ssh chihuahua@example.org" to connect to your server with a limited user.

To completely remove the Chihuahua setup from your server, use the following commands:

sudo userdel -r chihuahua
sudo apt-get remove --auto-remove monitoring-plugins # or "apk del monitoring-plugins" on Alpine
sudo rm /usr/local/bin/check_sudo
sudo sed -i '/^chihuahua /d' /etc/sudoers

API

TODO: this should be documented more thoroughly - maybe provide an API Blueprint?

GET /setup.sh
GET /checks
GET /checks/:server
GET /checks/:server/:check

Development

Requires Go

git clone https://codeberg.org/momar/chihuahua.git && cd chihuahua
cp resources/chihuahua.hcl .
go run ./cmd --debug

Roadmap

  • Add custom messages to checks
  • Add private/hidden checks
  • More notification providers (mainly Clockwork SMS)
  • Gitea integration
  • Provide a Prometheus exporter