The smallest watchdog on earth. Tiny, monitoring-plugins compatible monitoring with a status page. https://cloud.docker.com/repository/docker/momar/chihuahua/general
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Phillipp Engelke d04f0d8f41 Merge pull request 'Disable API when PORT=none (fixes #36)' (#60) from feature/port-none into master 11 months ago
cmd Fix all syntax errors with the new filter model (filters & config reload are untested) 11 months ago
config Remove "verify" for notifiers again (it's way too complex) 11 months ago
docs make doc clearer 11 months ago
notifiers Add environment variables for command notifier & simplify its log output 11 months ago
resources Show error in plaintext Mails 1 year ago
web Fix API URL in frontend (fixes #39) 2 years ago
.dockerignore Make Docker build correctly, fix #5 (ssh key & default config) & also make checks unknown on startup 2 years ago
.gitignore Fix .gitignore, docs for delay, email sender address & SSH key generation 2 years ago
Dockerfile Make Docker build correctly, fix #5 (ssh key & default config) & also make checks unknown on startup 2 years ago
LICENSE Publish first working public version (1.0) 3 years ago
README.md Fix setup.sh command in README.md & missing SSH keys 2 years ago
api.go Disable API when PORT=none (fixes #36) 11 months ago
check.go Limit maximum delay on startup to ConnectionTimeout * number of checks 1 year ago
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 2 years ago
go.mod Model & document filters for #31 11 months ago
notify.go Remove "verify" for notifiers again (it's way too complex) 11 months ago
types.go Remove "verify" for notifiers again (it's way too complex) 11 months ago

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