Simple exporter for Prometheus that supplies ZFS filesystem and zpool information
Project description
Simple Python ZFS exporter for Prometheus
This is a simple ZFS exporter as provider for the Prometheus time series database
and monitoring system written in Python. It uses
the prometheus-client Python
package to do the main work of running the webservice and managing the gauges.
It's just a wrapper that periodically calls the zfs list
and zpool status
commands to gather information about the filesystems and the pools which is then
provided on the specified TCP port where it's collected by Prometheus at the
specified scrape interval. Note that this exporter does only scrape the filesystem
properties at a configurable interval instead at the query time of the time
series database itself.
Since this exporter scrapes the output of the CLI tools it may break with any software update and might only work with particular versions of those tools. It has been tested on:
- FreeBSD 11.2
- FreeBSD 12.2
Exported metrics
- For each ZFS filesystem (
filesystem
used as label):- Used bytes (
zfs_used
) - Available bytes (
zfs_avail
) - Referred bytes (
zfs_referred
)
- Used bytes (
- For each pool (
pool
used as label):- Resilvered percentage (
zpoolResilvered
) - Resilvered bytes (
zpoolResilveredByte
) - Scrub scanned bytes (
zpoolScrubScanned
) - Scrub datarate (
zpool_scrub_rate
) - Scrub scanned percentage (
zpool_scrub_scanned_pct
)
- Resilvered percentage (
- For each
vdev
(vdev
used as label):- Read errors (
zpoolErrorRead
) - Write errors (
zpoolErrorWrite
) - Checksum errors (
zpoolErrorChecksum
) - Operations read (
zpool_opread
) - Operations write (
zpool_opwrite
) - Bandwidth read (
zpool_bwread
) - Bandwidth write (
zpool_bwwrite
)
- Read errors (
- For each non terminal
vdev
(vdev
used as label):- Allocated capacity (
zpool_capacityallocated
) - Free capacity (
zpool_capacityfree
)
- Allocated capacity (
Installation
The package can either be installed from PyPI
pip install zfsexporter-tspspi
or form a package downloaded directly from the tar.gz
or whl
from
the releases:
pip install zfsexporter-tspspi.tar.gz
Usage
usage: zfsexporter [-h] [-f] [--uid UID] [--gid GID] [--chroot CHROOT] [--pidfile PIDFILE] [--loglevel LOGLEVEL] [--logfile LOGFILE] [--port PORT] [--interval INTERVAL]
ZFS exporter daemon
optional arguments:
-h, --help show this help message and exit
-f, --foreground Do not daemonize - stay in foreground and dump debug information to the terminal
--uid UID User ID to impersonate when launching as root
--gid GID Group ID to impersonate when launching as root
--chroot CHROOT Chroot directory that should be switched into
--pidfile PIDFILE PID file to keep only one daemon instance running
--loglevel LOGLEVEL Loglevel to use (debug, info, warning, error, critical). Default: error
--logfile LOGFILE Logfile that should be used as target for log messages
--port PORT Port to listen on
--interval INTERVAL Interval in seconds in which data is gathered
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for zfsexporter_tspspi-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e897137a9b213830c21dc784559ad4a2f30aa5c7981aed3e9bf89b714bb83cef |
|
MD5 | 94fa3c46a0ef1a0914b1a8b182206b53 |
|
BLAKE2b-256 | 2cb3b62dafc80890b10794bad84eae3c01cf44627e6be490a299bbf669beeb94 |