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.
Moritz Marquardt ecee1ee6aa Add private checks/output to todo list in README.md 5 months ago
cmd Simplify command-line argument logic 6 months ago
types Add update date to frontend, add some instructions to README, undo TTY allocation 6 months ago
web Bundle libraries (fixes #8) and use Macy.js for masonry layout 5 months ago
.dockerignore Make cache persistent 6 months ago
.gitignore Make cache persistent 6 months ago
Dockerfile Add /setup.sh script and support for a server-side .chihuahuarc file 5 months ago
LICENSE Publish first working public version (1.0) 6 months ago
README.md Add private checks/output to todo list in README.md 5 months ago
api.go Bundle libraries (fixes #8) and use Macy.js for masonry layout 5 months ago
check.go Fix .chihuahuarc script and use strict mode for setup script 5 months ago
chihuahua.example.yml Publish first working public version (1.0) 6 months ago
go.mod Convert to a Go module 5 months ago
go.sum Convert to a Go module 5 months ago
notify.go Make cache persistent 6 months ago
print.go Publish first working public version (1.0) 6 months ago
setup.go Fix .chihuahuarc script and use strict mode for setup script 5 months ago

README.md

chihuahua

The smallest watchdog on earth. Tiny, monitoring-plugins compatible monitoring with a status page, built with Go, Air, Vue.js and Bulma.

  • Run nagios checks on a remote server
  • Alert on state change via Gotify or email

Screenshot

Getting Started

mkdir -p ./data/.ssh
ssh-keygen -b 2048 -f ./data/.ssh/id_rsa -P "" -C "Chihuahua Monitoring"
nano ./data/chihuahua.yml
docker run -d -p 8080:80 -v "$PWD/data:/data" momar/chihuahua

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

Example chihuahua.yml

notifications:
- provider: gotify # Send notifications via https://gotify.net/
  server: https://gotify.example.org
  token: QwErTyUiOpAsDfG
- provider: email # Send notifications via E-Mail
  host: smtp.example.org
  port: 25
  username: example
  password: QwErTyUiOpAsDfG
  from: noreply@example.org
  to: postmaster@example.org

servers:
  example:
    ssh: monitoring@example.org -p 2222 # SSH connection parameters for the server. Leave away to run checks locally. You can add a ~/.chihuahuarc on the server that's being run before each check.
    checks:
      disk-space: check_disk -w 15% -c 5% # any monitoring-plugins compatible check command works here - you can basically use every command that returns 0 on success, 1 on warnings and 2 on critical errors
      sudo-check: check_sudo check_disk -w 15% -c 5% # run checks as root
      ram-check: check_linux_memory # run checks in /var/chihuahua - download like that: wget https://raw.githubusercontent.com/hugme/Nag_checks/master/check_linux_memory -O /var/chihuahua/ && chmod +x /var/chihuahua/check_linux_memory

      # Examples for basic checks:
      http: check_http -H example.org -w 2 -c 15 -t 20 --sni --ssl -r "This domain is established to be used for illustrative examples in documents."
      ssh: check_ssh -t 15 example.org 
      process: "check_procs -c 1: -C nginx" # check if nginx is running (has at least 1 process)
      errorInLogfile: check_sudo check_log -F /var/log/auth.log -O ./logs/auth.log -q "session opened for user root" # check for root sessions
      backupInLast24h: check_file_age -c 86400 /mnt/backup/meta.json # check if there was a backup in the last 24 hours (86400 seconds)

Example debian server setup

sudo sh <(curl http://status.example.org:8080/setup.sh)

API

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 chihuahua.example.yml chihuahua.yml && nano chihuahua.yml
go generate && DEBUG=1 go run ./cmd -c chihuahua.yml

Roadmap

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