Dark3clipse/zmonitor

A FreeBSD utility for sending node utilization and zpool statistics over a serial connection.

★ 0Forks 0PythonGitHub ↗Compare

README

zmonitor

zmonitor is a FreeBSD utility for sending node utilization and zpool statistics over a serial connection.

Features

  • Serial: Establish a serial connection with an Indicator Panel (see this project: TBD).
  • Data: Gathers system and zpool statistics and sends them over the serial connection.

Installation

Using mediarr repository

Add mediarr repository to your system:

mkdir -p /usr/local/etc/pkg/repos
cat <<EOF> /usr/local/etc/pkg/repos/mediarr.conf
mediarr: {
  url: "https://static.mediarr.org/freebsd-repo",
  enabled: yes
}
EOF

Install package:

pkg update
pkg install zmonitor

Using make

You can install zmonitor via my FreeBSD ports repository.

Note: Ensure you have the ports tree installed (refer to the freebsd ports repository for instructions).

git clone https://github.com/Dark3clipse/freebsd-ports.git /usr/local/freebsd-ports
mkdir -p /usr/ports/local/devel
mkdir -p /usr/ports/local/sysutils
ln -s /usr/local/freebsd-ports/devel/docopts /usr/ports/local/devel/docopts
ln -s /usr/local/freebsd-ports/sysutils/zmonitor /usr/ports/local/sysutils/zmonitor
cd /usr/local/freebsd-ports/sysutils/zmonitor
sudo make install clean
sudo cp /usr/local/etc/zmonitor.conf.sample /usr/local/etc/zmonitor.conf

Don't forget to edit your configuration file to your needs!

Usage

Usage:
  zmonitor

Configuration

zmonitor uses the configuration file located at /usr/local/etc/zmonitor.conf.

Lines beginning with # are comments. The default configuration contains sections for general settings, logging, operation modes, and watcher settings.

Example Configuration

[zmonitor]
serial_port = "/dev/cuaU0"
baudrate = 115200
zpool_name = rpool
interval = 1.0
zpool_read_max_mb = 269
zpool_write_max_mb = 269
disk_serials = SERIAL1, SERIAL2
  • Modify serial_port to your indicator panel serial port.
  • Modify zpool_name to the zfs pool you want to monitor.
  • Set zpool_read_max_mb and zpool_write_max_mb to your theoretically maximum read and write bandwidth respectivelly (e.g. using zfs-calc).
  • Set disk_serials to an ordered list of your disk serials.

Dependencies

  • Required ports:
    • python311 — Python
    • py311-pyserial — for serial connectivity in Python
    • py311-psutil — for obtaining system statistics in Python

License

This project is licensed under the BSD 2-Clause License – see the LICENSE file for details.

Contributors

Dark3clipse

Issues