Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2019 00:33:41 +0000 (UTC)
From:      Steve Wills <swills@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r491664 - in head/www: . varnish_exporter varnish_exporter/files
Message-ID:  <201901310033.x0V0Xf7H085169@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: swills
Date: Thu Jan 31 00:33:41 2019
New Revision: 491664
URL: https://svnweb.freebsd.org/changeset/ports/491664

Log:
  www/varnish_exporter: create port
  
  Varnish exporter for Prometheus. Scrapes the varnishstat -j JSON output on each
  Prometheus collect and exposes all reported metrics.
  
  WWW: https://github.com/jonnenauha/prometheus_varnish_exporter
  
  PR:		230177
  Submitted by:	Žygis Škulteckis <ports@zx23.net> (maintainer)

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

Modified: head/www/Makefile
==============================================================================
--- head/www/Makefile	Thu Jan 31 00:08:46 2019	(r491663)
+++ head/www/Makefile	Thu Jan 31 00:33:41 2019	(r491664)
@@ -2405,6 +2405,7 @@
     SUBDIR += varnish-nagios
     SUBDIR += varnish4
     SUBDIR += varnish6
+    SUBDIR += varnish_exporter
     SUBDIR += vdr-plugin-live
     SUBDIR += vdradmin-am
     SUBDIR += vee

Added: head/www/varnish_exporter/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/varnish_exporter/Makefile	Thu Jan 31 00:33:41 2019	(r491664)
@@ -0,0 +1,50 @@
+# $FreeBSD$
+
+PORTNAME=		varnish_exporter
+PORTVERSION=		1.4.1
+CATEGORIES=		www
+
+MAINTAINER=		ports@zx23.net
+COMMENT=		Prometheus metrics exporter for the Varnish WWW cache
+
+LICENSE=		APACHE20
+
+USES=			go
+USE_GITHUB=		yes
+
+GH_ACCOUNT=		jonnenauha
+GH_PROJECT=		prometheus_varnish_exporter
+GH_TUPLE=		prometheus:client_golang:v0.8.0:client_golang \
+			beorn7:perks:3a771d9:perks \
+			golang:protobuf:70b3af3:protobuf \
+			matttproud:golang_protobuf_extensions:c12348c:golang_protobuf_extensions \
+			prometheus:client_model:5c3871d:client_model \
+			prometheus:common:7600349:common \
+			prometheus:procfs:ae68e2d:procfs
+
+GO_PKGNAME=		github.com/${GH_ACCOUNT}/${GH_PROJECT}
+
+USE_RC_SUBR=		${PORTNAME}
+
+USERS=			varnish
+GROUPS=			varnish
+
+PLIST_FILES=		bin/${PORTNAME}
+
+pre-build:
+	${MKDIR} ${GO_WRKDIR_SRC}/github.com/beorn7
+	${MKDIR} ${GO_WRKDIR_SRC}/github.com/golang
+	${MKDIR} ${GO_WRKDIR_SRC}/github.com/matttproud
+	${MKDIR} ${GO_WRKDIR_SRC}/github.com/prometheus
+	${MV} ${WRKSRC_client_golang} ${GO_WRKDIR_SRC}/github.com/prometheus/client_golang
+	${MV} ${WRKSRC_client_model} ${GO_WRKDIR_SRC}/github.com/prometheus/client_model
+	${MV} ${WRKSRC_common} ${GO_WRKDIR_SRC}/github.com/prometheus/common
+	${MV} ${WRKSRC_perks} ${GO_WRKDIR_SRC}/github.com/beorn7/perks
+	${MV} ${WRKSRC_procfs} ${GO_WRKDIR_SRC}/github.com/prometheus/procfs
+	${MV} ${WRKSRC_protobuf} ${GO_WRKDIR_SRC}/github.com/golang/protobuf
+	${MV} ${WRKSRC_golang_protobuf_extensions} ${GO_WRKDIR_SRC}/github.com/matttproud/golang_protobuf_extensions
+
+do-install:
+	${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/prometheus_varnish_exporter ${STAGEDIR}${PREFIX}/bin/varnish_exporter
+
+.include <bsd.port.mk>

Added: head/www/varnish_exporter/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/varnish_exporter/distinfo	Thu Jan 31 00:33:41 2019	(r491664)
@@ -0,0 +1,17 @@
+TIMESTAMP = 1531473283
+SHA256 (jonnenauha-prometheus_varnish_exporter-1.4.1_GH0.tar.gz) = 20deb875de670a196b6638e5feacaf40dcb922255392f092c5b0790928652260
+SIZE (jonnenauha-prometheus_varnish_exporter-1.4.1_GH0.tar.gz) = 197319
+SHA256 (prometheus-client_golang-v0.8.0_GH0.tar.gz) = 88b0040393276116f848de5bdd636717d339667273cfc45a4edda40b5e5682bd
+SIZE (prometheus-client_golang-v0.8.0_GH0.tar.gz) = 75593
+SHA256 (beorn7-perks-3a771d9_GH0.tar.gz) = b7a0faebca98ebd5e7546403b4cdea9dc77f865f0623d04efbad33e984297cc9
+SIZE (beorn7-perks-3a771d9_GH0.tar.gz) = 10800
+SHA256 (golang-protobuf-70b3af3_GH0.tar.gz) = fd81970d30eba8f3d49c5b27eb80728060f022bb391515e8d79724d5b39dc1f9
+SIZE (golang-protobuf-70b3af3_GH0.tar.gz) = 329777
+SHA256 (matttproud-golang_protobuf_extensions-c12348c_GH0.tar.gz) = da165c9275b77a0994b815bc7d761dcb2e4799a90fe49eec08d8bdff3a683f48
+SIZE (matttproud-golang_protobuf_extensions-c12348c_GH0.tar.gz) = 37200
+SHA256 (prometheus-client_model-5c3871d_GH0.tar.gz) = 5decfffcc4a7cfbce4214e42aaf0e3af9acdadf5d3f3ef6733868314171fd2f0
+SIZE (prometheus-client_model-5c3871d_GH0.tar.gz) = 57126
+SHA256 (prometheus-common-7600349_GH0.tar.gz) = 428d2301007b765ae36a64114b2f4806556c602dba34c011a10caaae76cbb433
+SIZE (prometheus-common-7600349_GH0.tar.gz) = 77805
+SHA256 (prometheus-procfs-ae68e2d_GH0.tar.gz) = d2ef0107607a9e0fcfccbe7d0a364ea04de741d464b244994fb579f2610dfb4f
+SIZE (prometheus-procfs-ae68e2d_GH0.tar.gz) = 57790

Added: head/www/varnish_exporter/files/varnish_exporter.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/varnish_exporter/files/varnish_exporter.in	Thu Jan 31 00:33:41 2019	(r491664)
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# PROVIDE: varnish_exporter
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# varnish_exporter_enable (bool):         Set to NO by default.
+#                                         Set it to YES to enable varnish_exporter.
+# varnish_exporter_user (string):         Set user that varnish_exporter will run under
+#                                         Default is "varnish".
+# varnish_exporter_group (string):        Set group that varnish_exporter will run under
+#                                         Default is "varnish".
+# varnish_exporter_syslog_priority (str): Set to "info" by default.
+#                                         Set it to priority to be used by syslog
+# varnish_exporter_syslog_facility (str): Set to "daemon" by default.
+#                                         Set it to facility to be used by syslog
+# varnish_exporter_syslog_tag (str):      Set to "ipfs-go" by default.
+#                                         Set it to tag to be used by syslog
+
+. /etc/rc.subr
+
+name=varnish_exporter
+rcvar=varnish_exporter_enable
+
+load_rc_config $name
+
+: ${varnish_exporter_enable:="NO"}
+: ${varnish_exporter_user:="varnish"}
+: ${varnish_exporter_group:="varnish"}
+: ${varnish_exporter_syslog_priority:="info"}
+: ${varnish_exporter_syslog_facility:="daemon"}
+: ${varnish_exporter_syslog_tag:="varnish-exporter"}
+
+pidfile="/var/run/${name}.pid"
+command="/usr/sbin/daemon"
+procname="%%PREFIX%%/bin/${name}"
+command_args="-S -m 3 -s ${varnish_exporter_syslog_priority} -l ${varnish_exporter_syslog_facility} -T ${varnish_exporter_syslog_tag} -p ${pidfile} /usr/bin/env ${procname} ${varnish_exporter_args}"
+
+start_precmd=${name}_startprecmd
+extra_commands="reload"
+
+varnish_exporter_startprecmd()
+{
+    if [ ! -e ${pidfile} ]; then
+        install \
+            -o ${varnish_exporter_user} \
+            -g ${varnish_exporter_group} \
+            /dev/null ${pidfile};
+    fi
+}
+
+load_rc_config $name
+run_rc_command "$1"

Added: head/www/varnish_exporter/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/varnish_exporter/pkg-descr	Thu Jan 31 00:33:41 2019	(r491664)
@@ -0,0 +1,4 @@
+Varnish exporter for Prometheus. Scrapes the varnishstat -j JSON output on each
+Prometheus collect and exposes all reported metrics.
+
+WWW: https://github.com/jonnenauha/prometheus_varnish_exporter



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