Skip to main content

Prometheus 的简单导出器,提供 ZFS 文件系统和 zpool 信息

项目描述

Prometheus 的简单 Python ZFS 导出器

这是一个简单的 ZFS 导出器,作为用 Python 编写的Prometheus 时间序列数据库和监控系统的提供者。它使用prometheus-client Python 包来完成运行 web 服务和管理仪表的主要工作。它只是一个包装器,它定期调用zfs listzpool status 命令来收集有关文件系统和池的信息,然后在指定的 TCP 端口上提供这些信息,Prometheus 在指定的抓取时间间隔收集这些信息。请注意,此导出器仅在可配置的时间间隔而不是在时间序列数据库本身的查询时间刮取文件系统属性。

由于此导出器会抓取 CLI 工具的输出,因此它可能会因任何软件更新而中断,并且可能仅适用于这些工具的特定版本。它已经过测试:

  • FreeBSD 11.2
  • FreeBSD 12.2

导出的指标

  • 对于每个 ZFS 文件系统(filesystem用作标签):
    • 已用字节 ( zfs_used)
    • 可用字节 ( zfs_avail)
    • 引用字节 ( zfs_referred)
  • 对于每个池(pool用作标签):
    • 重新银化百分比 ( zpoolResilvered)
    • 重新同步的字节 ( zpoolResilveredByte)
    • 擦洗扫描的字节 ( zpoolScrubScanned)
    • 擦洗数据速率 ( zpool_scrub_rate)
    • 擦洗扫描百分比 ( zpool_scrub_scanned_pct)
  • 对于每个vdevvdev用作标签):
    • 读取错误 ( zpoolErrorRead)
    • 写入错误 ( zpoolErrorWrite)
    • 校验和错误 ( zpoolErrorChecksum)
    • 操作读取 ( zpool_opread)
    • 操作写入 ( zpool_opwrite)
    • 带宽读取 ( zpool_bwread)
    • 带宽写入 ( zpool_bwwrite)
  • 对于每个非终端vdevvdev用作标签):
    • 分配容量 ( zpool_capacityallocated)
    • 可用容量 ( zpool_capacityfree)

安装

该软件包可以从 PyPI 安装

pip install zfsexporter-tspspi

或形成直接从tar.gzwhl版本下载的包:

pip install zfsexporter-tspspi.tar.gz

用法

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

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

zfsexporter-tspspi-0.0.2.tar.gz (6.5 kB 查看哈希

已上传 source

内置分布

zfsexporter_tspspi-0.0.2-py3-none-any.whl (7.5 kB 查看哈希

已上传 py3