Page MenuHomeDevCentral

No OneTemporary

diff --git a/net-mgmt/phpfpm_exporter_lusitaniae/Makefile b/net-mgmt/phpfpm_exporter_lusitaniae/Makefile
index c829a31..1fbf440 100644
--- a/net-mgmt/phpfpm_exporter_lusitaniae/Makefile
+++ b/net-mgmt/phpfpm_exporter_lusitaniae/Makefile
@@ -1,38 +1,40 @@
PORTNAME= phpfpm_exporter_lusitaniae
PORTVERSION= 0.6.0
CATEGORIES= net-mgmt
MAINTAINER= dereckson@gmail.com
COMMENT= Export php-fpm metrics in Prometheus format
WWW= https://github.com/Lusitaniae/php-fpm_exporter
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules
USE_GITHUB= yes
GH_ACCOUNT= Lusitaniae
GH_PROJECT= phpfpm_exporter
GH_TAGNAME= v${PORTVERSION}
GH_TUPLE= \
alecthomas:kingpin:v2.2.6:alecthomas_kingpin/vendor/gopkg.in/alecthomas/kingpin.v2 \
alecthomas:template:fb15b899a751:alecthomas_template/vendor/github.com/alecthomas/template \
alecthomas:units:f65c72e2690d:alecthomas_units/vendor/github.com/alecthomas/units \
beorn7:perks:v1.0.1:beorn7_perks/vendor/github.com/beorn7/perks \
cespare:xxhash:v2.1.1:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \
golang:protobuf:v1.4.3:golang_protobuf/vendor/github.com/golang/protobuf \
golang:sys:04245dca01da:golang_sys/vendor/golang.org/x/sys \
matttproud:golang_protobuf_extensions:v1.0.1:matttproud_golang_protobuf_extensions/vendor/github.com/matttproud/golang_protobuf_extensions \
prometheus:client_golang:v1.10.0:prometheus_client_golang/vendor/github.com/prometheus/client_golang \
prometheus:client_model:v0.2.0:prometheus_client_model/vendor/github.com/prometheus/client_model \
prometheus:common:v0.27.0:prometheus_common/vendor/github.com/prometheus/common \
prometheus:procfs:v0.6.0:prometheus_procfs/vendor/github.com/prometheus/procfs \
protocolbuffers:protobuf-go:v1.25.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf \
tomasen:fcgi_client:2bb3d819fd19:tomasen_fcgi_client/vendor/github.com/tomasen/fcgi_client
GO_TARGET= :phpfpm_exporter
+USE_RC_SUBR= phpfpm_exporter
+
CONFLICTS= phpfpm_exporter
PLIST_FILES= bin/phpfpm_exporter
.include <bsd.port.mk>
diff --git a/net-mgmt/phpfpm_exporter_lusitaniae/files/phpfpm_exporter.in b/net-mgmt/phpfpm_exporter_lusitaniae/files/phpfpm_exporter.in
new file mode 100644
index 0000000..014c13a
--- /dev/null
+++ b/net-mgmt/phpfpm_exporter_lusitaniae/files/phpfpm_exporter.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+# PROVIDE: phpfpm_exporter
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# phpfpm_exporter_enable (bool): Set it to YES to enable phpfpm_exporter.
+# Default is "NO".
+# phpfpm_exporter_user (user): Set user to run phpfpm_exporter.
+# That user needs read access to php-fpm sockets.
+# Default is "nobody".
+# phpfpm_exporter_sockets_root (path): Set the root directory where to find php-fpm sockets.
+# Default is "/var/run".
+# phpfpm_exporter_sockets_pattern (path): Set the pattern to match php-fpm sockets paths.
+# Default is "php-fpm.sock".
+# phpfpm_exporter_status (string): Set to the php-fpm pm.status_path value.
+# Default is "/status".
+# phpfpm_exporter_address (string): Set the address listened by metrics exporter.
+# Default is "127.0.0.1:9253"
+
+. /etc/rc.subr
+
+name=phpfpm_exporter
+rcvar=phpfpm_exporter_enable
+
+load_rc_config $name
+
+: ${phpfpm_exporter_enable:="NO"}
+: ${phpfpm_exporter_user:="nobody"}
+: ${phpfpm_exporter_sockets_root:="/var/run"}
+: ${phpfpm_exporter_sockets_pattern:="php-fpm.sock"}
+: ${phpfpm_exporter_status:="/status"}
+: ${phpfpm_exporter_address:="127.0.0.1:9253"}
+
+sockets_found=$(find "${phpfpm_exporter_sockets_root}" -type s -name "${phpfpm_exporter_sockets_pattern}" -print0 | xargs -0 -n1 echo --phpfpm.socket-paths | paste -sd " " -)
+
+phpfpm_exporter_args="--web.listen-address=${phpfpm_exporter_address} --phpfpm.status-path=${phpfpm_exporter_status}"
+
+pidfile=/var/run/phpfpm_exporter.pid
+procname="phpfpm_exporter"
+command="/usr/sbin/daemon"
+command_args="-f -t ${name} -p ${pidfile} ${procname} ${phpfpm_exporter_args} ${sockets_found}"
+
+start_precmd=phpfpm_exporter_startprecmd
+required_files="$phpfpm_exporter_config"
+
+phpfpm_exporter_startprecmd()
+{
+ touch ${pidfile}
+ chown ${phpfpm_exporter_user} ${pidfile}
+}
+
+run_rc_command "$1"

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 10:50 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260032
Default Alt Text
(4 KB)

Event Timeline