Skip to main content

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)
  • 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)
  • 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)
  • For each non terminal vdev (vdev used as label):
    • Allocated capacity (zpool_capacityallocated)
    • Free capacity (zpool_capacityfree)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zfsexporter-tspspi-0.0.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zfsexporter_tspspi-0.0.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file zfsexporter-tspspi-0.0.2.tar.gz.

File metadata

  • Download URL: zfsexporter-tspspi-0.0.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for zfsexporter-tspspi-0.0.2.tar.gz
Algorithm Hash digest
SHA256 781d1bdc6ff04ea52ad3ea1c82c88a70fce6d7b0091c03439c1e47902bf00767
MD5 63710107c93cafb58be2402a6be71a2b
BLAKE2b-256 3b93fd8769fc7312cfe234fbbf02444f7574813be4b0776264a7690427e4e925

See more details on using hashes here.

File details

Details for the file zfsexporter_tspspi-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: zfsexporter_tspspi-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for zfsexporter_tspspi-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e897137a9b213830c21dc784559ad4a2f30aa5c7981aed3e9bf89b714bb83cef
MD5 94fa3c46a0ef1a0914b1a8b182206b53
BLAKE2b-256 2cb3b62dafc80890b10794bad84eae3c01cf44627e6be490a299bbf669beeb94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page