Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 07:49:21 +0000 (UTC)
From:      Li-Wen Hsu <lwhsu@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r462476 - in head/sysutils: . phpfpm_exporter phpfpm_exporter/files
Message-ID:  <201802210749.w1L7nLEe094445@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lwhsu
Date: Wed Feb 21 07:49:21 2018
New Revision: 462476
URL: https://svnweb.freebsd.org/changeset/ports/462476

Log:
  Add sysutils/phpfpm_exporter, export php-fpm metrics in Prometheus format
  
  PR:		224261
  Submitted by:	Gasol Wu <gasol.wu@gmail.com>

Added:
  head/sysutils/phpfpm_exporter/
  head/sysutils/phpfpm_exporter/Makefile   (contents, props changed)
  head/sysutils/phpfpm_exporter/distinfo   (contents, props changed)
  head/sysutils/phpfpm_exporter/files/
  head/sysutils/phpfpm_exporter/files/phpfpm_exporter.in   (contents, props changed)
  head/sysutils/phpfpm_exporter/pkg-descr   (contents, props changed)
Modified:
  head/sysutils/Makefile

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Wed Feb 21 05:48:46 2018	(r462475)
+++ head/sysutils/Makefile	Wed Feb 21 07:49:21 2018	(r462476)
@@ -851,6 +851,7 @@
     SUBDIR += php71-posix
     SUBDIR += php72-fileinfo
     SUBDIR += php72-posix
+    SUBDIR += phpfpm_exporter
     SUBDIR += phybs
     SUBDIR += pick
     SUBDIR += pidof

Added: head/sysutils/phpfpm_exporter/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/phpfpm_exporter/Makefile	Wed Feb 21 07:49:21 2018	(r462476)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+PORTNAME=	phpfpm_exporter
+PORTVERSION=	0.3.3
+DISTVERSIONPREFIX=v
+CATEGORIES=	sysutils
+
+MAINTAINER=	gasol.wu@gmail.com
+COMMENT=	Export php-fpm metrics in Prometheus format
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		go
+USE_GITHUB=	yes
+GH_ACCOUNT=	bakins
+GH_PROJECT=	php-fpm-exporter
+
+GO_PKGNAME=	github.com/${GH_ACCOUNT}/${GH_PROJECT}
+PLIST_FILES=	bin/${PORTNAME}
+USE_RC_SUBR=	phpfpm_exporter
+
+do-build:
+	@(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} CGO_ENABLED=0 ${GO_CMD} build -o ${PORTNAME} ./cmd/${GH_PROJECT})
+
+do-install:
+	${INSTALL_PROGRAM} ${GO_WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>

Added: head/sysutils/phpfpm_exporter/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/phpfpm_exporter/distinfo	Wed Feb 21 07:49:21 2018	(r462476)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1512723537
+SHA256 (bakins-php-fpm-exporter-v0.3.3_GH0.tar.gz) = 02b6ee16d3c595430dd875953639daa95e2b41e9f78e1aca45656e9f5e196b4c
+SIZE (bakins-php-fpm-exporter-v0.3.3_GH0.tar.gz) = 1510300

Added: head/sysutils/phpfpm_exporter/files/phpfpm_exporter.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/phpfpm_exporter/files/phpfpm_exporter.in	Wed Feb 21 07:49:21 2018	(r462476)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: phpfpm_exporter
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# phpfpm_exporter_enable (bool):          Set to NO by default.
+#               Set it to YES to enable phpfpm_exporter.
+# phpfpm_exporter_user (string):          Set user that phpfpm_exporter will run under
+#               Default is "nobody".
+# phpfpm_exporter_group (string):         Set group that phpfpm_exporter will run under
+#               Default is "nobody".
+# phpfpm_exporter_endpoint (string):      Set status endpoint
+#               Default is "http://127.0.0.1:9000/status".
+# phpfpm_exporter_listen_address (string): Set ip:port that phpfpm_exporter will listen on
+#               Default is "127.0.0.1:8080".
+
+. /etc/rc.subr
+
+name=phpfpm_exporter
+rcvar=phpfpm_exporter_enable
+
+load_rc_config $name
+
+: ${phpfpm_exporter_enable:="NO"}
+: ${phpfpm_exporter_user:="nobody"}
+: ${phpfpm_exporter_group:="nobody"}
+: ${phpfpm_exporter_endpoint:="http://127.0.0.1:9000/status"}
+: ${phpfpm_exporter_listen_address:="127.0.0.1:8080"}
+
+
+pidfile=/var/run/phpfpm_exporter.pid
+command="/usr/sbin/daemon"
+procname="%%PREFIX%%/bin/phpfpm_exporter"
+command_args="-p ${pidfile} /usr/bin/env ${procname} \
+    --addr ${phpfpm_exporter_listen_address} \
+    --endpoint ${phpfpm_exporter_endpoint}"
+
+start_precmd=phpfpm_exporter_startprecmd
+
+phpfpm_exporter_startprecmd()
+{
+    if [ ! -e ${pidfile} ]; then
+        install -o ${phpfpm_exporter_user} -g ${phpfpm_exporter_group} /dev/null ${pidfile};
+    fi
+}
+
+load_rc_config $name
+run_rc_command "$1"

Added: head/sysutils/phpfpm_exporter/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/phpfpm_exporter/pkg-descr	Wed Feb 21 07:49:21 2018	(r462476)
@@ -0,0 +1,3 @@
+Export php-fpm metrics in Prometheus format.
+
+WWW: https://github.com/bakins/php-fpm-exporter



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802210749.w1L7nLEe094445>