From nobody Tue Oct 05 16:00:14 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 3101312BDDB6; Tue, 5 Oct 2021 16:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HP2Nb0qQzz3MH4; Tue, 5 Oct 2021 16:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F01A878EF; Tue, 5 Oct 2021 16:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 195G0EKs015201; Tue, 5 Oct 2021 16:00:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 195G0Eg2015193; Tue, 5 Oct 2021 16:00:14 GMT (envelope-from git) Date: Tue, 5 Oct 2021 16:00:14 GMT Message-Id: <202110051600.195G0Eg2015193@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 45ba01cf1b21 - main - sysutils/py-prometheus-zfs: New port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45ba01cf1b21db5d3e8ebba6aad68d76f5792612 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/ports/commit/?id=45ba01cf1b21db5d3e8ebba6aad68d76f5792612 commit 45ba01cf1b21db5d3e8ebba6aad68d76f5792612 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2021-10-05 15:57:28 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2021-10-05 15:59:26 +0000 sysutils/py-prometheus-zfs: New port Prometheus exporter for ZFS statistics using py-libzfs. WWW: https://github.com/matusnovak/prometheus-zfs --- sysutils/Makefile | 1 + sysutils/py-prometheus-zfs/Makefile | 34 +++++++++++++++++++++++++++++ sysutils/py-prometheus-zfs/distinfo | 3 +++ sysutils/py-prometheus-zfs/files/zfsprom.in | 29 ++++++++++++++++++++++++ sysutils/py-prometheus-zfs/pkg-descr | 5 +++++ 5 files changed, 72 insertions(+) diff --git a/sysutils/Makefile b/sysutils/Makefile index 1265c07d472d..e0dbc39b49a8 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -1052,6 +1052,7 @@ SUBDIR += py-ploy_ezjail SUBDIR += py-plumbum SUBDIR += py-power + SUBDIR += py-prometheus-zfs SUBDIR += py-psutil SUBDIR += py-psutil121 SUBDIR += py-ptyprocess diff --git a/sysutils/py-prometheus-zfs/Makefile b/sysutils/py-prometheus-zfs/Makefile new file mode 100644 index 000000000000..5d73ec7f132e --- /dev/null +++ b/sysutils/py-prometheus-zfs/Makefile @@ -0,0 +1,34 @@ +# Created by: Mateusz Piotrowski <0mp@FreeBSD.org> + +PORTNAME= prometheus-zfs +DISTVERSIONPREFIX= v +DISTVERSION= 1.0.3 +CATEGORIES= sysutils python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= 0mp@FreeBSD.org +COMMENT= Prometheus exporter for ZFS statistics using py-libzfs + +LICENSE= UNLICENSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}libzfs>=0:devel/py-libzfs@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}prometheus-client>=0:net-mgmt/py-prometheus-client@${PY_FLAVOR} + +USES= python:3.6+ shebangfix +USE_GITHUB= yes +GH_ACCOUNT= matusnovak +USE_RC_SUBR= zfsprom +SHEBANG_FILES= zfsprom.py + +NO_ARCH= yes +NO_BUILD= yes + +SUB_LIST= PYTHON_CMD=${PYTHON_CMD} + +PLIST_FILES= sbin/zfsprom.py + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/zfsprom.py ${STAGEDIR}${PREFIX}/sbin + +.include diff --git a/sysutils/py-prometheus-zfs/distinfo b/sysutils/py-prometheus-zfs/distinfo new file mode 100644 index 000000000000..4090a4cb3280 --- /dev/null +++ b/sysutils/py-prometheus-zfs/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1633446717 +SHA256 (matusnovak-prometheus-zfs-v1.0.3_GH0.tar.gz) = 6d3c1e0100a85aecd94a32c2ff94552d7f4a52197c563bb9af20ab39be890bbb +SIZE (matusnovak-prometheus-zfs-v1.0.3_GH0.tar.gz) = 3921 diff --git a/sysutils/py-prometheus-zfs/files/zfsprom.in b/sysutils/py-prometheus-zfs/files/zfsprom.in new file mode 100644 index 000000000000..b4943811d22b --- /dev/null +++ b/sysutils/py-prometheus-zfs/files/zfsprom.in @@ -0,0 +1,29 @@ +#! /bin/sh - +# +# SPDX-License-Identifier: (BSD-2-Clause or Unlicense) +# +# Copyright (c) 2021 Mateusz Piotrowski <0mp@FreeBSD.org> +# + +# Add the following lines to rc.conf(5) to configure the zfsprom service: +# +# zfsprom_enable (bool): Set to "YES" to enable the service. +# Default: "NO". + +# PROVIDE: zfsprom +# REQUIRE: DAEMON + +. /etc/rc.subr + +name="zfsprom" +rcvar="zfsprom_enable" + +load_rc_config "${name}" + +pidfile="/var/run/${name}.pid" +procname="%%PREFIX%%/sbin/zfsprom.py" +command_interpreter="%%PYTHON_CMD%%" +command="/usr/sbin/daemon" +command_args="-o /var/log/${name}.log -p ${pidfile} -- ${procname}" + +run_rc_command "$1" diff --git a/sysutils/py-prometheus-zfs/pkg-descr b/sysutils/py-prometheus-zfs/pkg-descr new file mode 100644 index 000000000000..168ce78e6a76 --- /dev/null +++ b/sysutils/py-prometheus-zfs/pkg-descr @@ -0,0 +1,5 @@ +This is a simple exporter for the Prometheus metrics for ZFS using +py-libzfs. It comes with a zfsprom service that can be run in the +background as an HTTP server. + +WWW: https://github.com/matusnovak/prometheus-zfs