Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ykgmfq/SystemPub

Repository files navigation

SystemPub

Monitor ZFS pools and systemd units using Home Assistant and MQTT.

SytemPub is designed for sanoid users who don't run a dedicated monitoring service like Nagios but also don't want to rely on a cloud service like Healthchecks.

SystemPub checks health and capacity of your local ZFS pools. It also verifies whether snapshots have been created as configured in sanoid. Under the hood, the Nagios-compatible sanoid --monitor-X commands are used.

Systemd is queried for any failed services. For remote backups, this is a great way to see if syncoid has failed to pull snapshots.

The pool state and system unit state are published as binary sensors on your MQTT server. Autodiscovery is supported, so there is no need for any further configuration in Home Assistant.

Installation

Grab the binary from the latest release page and copy it to /usr/local/bin/. Copy systempub.service to /etc/systemd/system and activate the service:

systemctl daemon-reload
systemctl enable --now systempub
systemctl status systempub

Configuration

Usage of SystemPub:
  -config string
        Config file (default "/etc/systempub.yaml")
  -debug
        sets log level to debug
  -host string
        MQTT server host
  -port int
        MQTT server port

The options can also be set in the configuration file:

mqttserver:
  host: 192.168.0.3
  port: 1883
loglevel: warn

Home Assistant

SystemPub registers the host device with Home Assistant and adds the sensors to it. If you run SystemPub on your main and backup devices you can tell them apart in Home Assistant via the host name, machine model and OS version.

Screenshot

About

Monitor ZFS pools and systemd units using Home Assistant and MQTT.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •