Prometheus 的简单导出器,提供 ZFS 文件系统和 zpool 信息
项目描述
Prometheus 的简单 Python ZFS 导出器
这是一个简单的 ZFS 导出器,作为用 Python 编写的Prometheus 时间序列数据库和监控系统的提供者。它使用prometheus-client Python 包来完成运行 web 服务和管理仪表的主要工作。它只是一个包装器,它定期调用zfs list和zpool 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)
- 重新银化百分比 (
- 对于每个
vdev(vdev用作标签):- 读取错误 (
zpoolErrorRead) - 写入错误 (
zpoolErrorWrite) - 校验和错误 (
zpoolErrorChecksum) - 操作读取 (
zpool_opread) - 操作写入 (
zpool_opwrite) - 带宽读取 (
zpool_bwread) - 带宽写入 (
zpool_bwwrite)
- 读取错误 (
- 对于每个非终端
vdev(vdev用作标签):- 分配容量 (
zpool_capacityallocated) - 可用容量 (
zpool_capacityfree)
- 分配容量 (
安装
该软件包可以从 PyPI 安装
pip install zfsexporter-tspspi
或形成直接从tar.gz或whl从版本下载的包:
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 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | 781d1bdc6ff04ea52ad3ea1c82c88a70fce6d7b0091c03439c1e47902bf00767 |
|
| MD5 | 63710107c93cafb58be2402a6be71a2b |
|
| 布莱克2-256 | 3b93fd8769fc7312cfe234fbbf02444f7574813be4b0776264a7690427e4e925 |
关
zfsexporter_tspspi -0.0.2-py3-none-any.whl 的哈希值
| 算法 | 哈希摘要 | |
|---|---|---|
| SHA256 | e897137a9b213830c21dc784559ad4a2f30aa5c7981aed3e9bf89b714bb83cef |
|
| MD5 | 94fa3c46a0ef1a0914b1a8b182206b53 |
|
| 布莱克2-256 | 2cb3b62dafc80890b10794bad84eae3c01cf44627e6be490a299bbf669beeb94 |