SystemPub

command module
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

README

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

The options can also be set in the configuration file:

mqttserver:
  host: mqtt://192.168.0.3:1883
loglevel: warn

For remote backup machines, you can set your broker to accept WebSocket connections. Then configure a subdomain on your ingress:

mqttserver:
  host: wss://mqtt.yourdomain.net
  username: backup1

Pass the password as a Service Credential named mqtt as shown in the service file in this repo.

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

Documentation

Overview

SystemPub is a service that publishes the state of ZFS pools and systemd units to an MQTT server. It is intended to be used with Home Assistant, and publishes the state of the pools and units as binary sensors. Autodiscovery is supported, so there is no need for any further configuration in Home Assistant.

Directories

Path Synopsis
Data models for SystemPub
Data models for SystemPub
Provides a MQTT client for Home Assistant sensors.
Provides a MQTT client for Home Assistant sensors.
Provides checks for the state of pool health, capacity and snapshots on the system.
Provides checks for the state of pool health, capacity and snapshots on the system.
Provides checks for the state of systemd units.
Provides checks for the state of systemd units.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL