Index: www/Makefile =================================================================== --- www/Makefile (revision 519194) +++ www/Makefile (working copy) @@ -453,6 +453,7 @@ SUBDIR += nginx-lite SUBDIR += nginx-naxsi SUBDIR += nginx-prometheus-exporter + SUBDIR += nginx-vts-exporter SUBDIR += nibbleblog SUBDIR += nift SUBDIR += node Index: www/nginx-vts-exporter/Makefile =================================================================== --- www/nginx-vts-exporter/Makefile (nonexistent) +++ www/nginx-vts-exporter/Makefile (working copy) @@ -0,0 +1,116 @@ +# $FreeBSD$ + +PORTNAME= nginx-vts-exporter +DISTVERSIONPREFIX= v +DISTVERSION= 0.10.3 +CATEGORIES= www + +MAINTAINER= joneum@FreeBSD.org +COMMENT= Server that scraps NGINX vts stats and export them via HTTP + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= gmake go +USE_RC_SUBR= nginx_vts_exporter +USE_GITHUB= yes +GH_ACCOUNT= hnlq715 + +GO_BUILDFLAGS= -v -ldflags "${LD_FLAG_STRING}" + +NGINX_VTS_EXPORTER_BINARY= nginx_vts_exporter +NGINX_VTS_EXPORTER_LOG_FILE= /var/log/nginx_vts_exporter.log +NGINX_VTS_EXPORTER_LOG_TAG= nginx_vts_exporter + +SUB_FILES= newsyslog.conf nginx_vts_exporter syslog.d.conf + +SUB_LIST= NGINX_VTS_EXPORTER_LOG_FILE=${NGINX_VTS_EXPORTER_LOG_FILE} \ + NGINX_VTS_EXPORTER_LOG_TAG=${NGINX_VTS_EXPORTER_LOG_TAG} + +BUILD_USER?= ${USER} +LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/github.com/prometheus/common/version +LD_FLAG_STRING= -s \ + ${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ + ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} \ + ${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ + ${LD_FLAG_X_PREFIX}.Version=${PORTVERSION} + +PLIST_FILES= bin/nginx_vts_exporter \ + etc/newsyslog.conf.d/nginx-vts-exporter.conf \ + etc/syslog.d/nginx-vts-exporter.conf + +do-install: + ${INSTALL_PROGRAM} \ + ${GO_WRKDIR_BIN}/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/bin/nginx_vts_exporter + + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/syslog.d + + ${INSTALL_DATA} \ + ${WRKDIR}/newsyslog.conf \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/${PORTNAME}.conf + + ${INSTALL_DATA} \ + ${WRKDIR}/syslog.d.conf \ + ${STAGEDIR}${PREFIX}/etc/syslog.d/${PORTNAME}.conf + +.include +# $FreeBSD$ + +PORTNAME= nginx-vts-exporter +DISTVERSIONPREFIX= v +DISTVERSION= 0.10.3 +CATEGORIES= www + +MAINTAINER= joneum@FreeBSD.org +COMMENT= Server that scraps NGINX vts stats and export them via HTTP + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go gmake +USE_RC_SUBR= nginx_vts_exporter +USE_GITHUB= yes +GH_ACCOUNT= hnlq715 + +GO_BUILDFLAGS= -v -ldflags "${LD_FLAG_STRING}" + +NGINX_VTS_EXPORTER_BINARY= nginx_vts_exporter +NGINX_VTS_EXPORTER_LOG_FILE= /var/log/nginx_vts_exporter.log +NGINX_VTS_EXPORTER_LOG_TAG= ${NGINX_VTS_EXPORTER_BINARY} + +SUB_FILES= newsyslog.conf nginx_vts_exporter syslog.d.conf + +SUB_LIST+= NGINX_VTS_EXPORTER_LOG_FILE=${NGINX_VTS_EXPORTER_LOG_FILE} \ + NGINX_VTS_EXPORTER_LOG_TAG=${NGINX_VTS_EXPORTER_LOG_TAG} + +BUILD_USER?= ${USER} +LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/vendor/github.com/prometheus/common/version +LD_FLAG_STRING= -s \ + ${LD_FLAG_X_PREFIX}.Branch=release-${PORTVERSION:R} \ + ${LD_FLAG_X_PREFIX}.BuildUser=${BUILD_USER} \ + ${LD_FLAG_X_PREFIX}.Revision=${PORTREVISION} \ + ${LD_FLAG_X_PREFIX}.Version=${PORTVERSION} + +PLIST_FILES= bin/nginx_vts_exporter \ + etc/newsyslog.conf.d/nginx-vts-exporter.conf \ + etc/syslog.d/nginx-vts-exporter.conf + +do-install: + ${INSTALL_PROGRAM} \ + ${GO_WRKDIR_BIN}/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/bin/${NGINX_VTS_EXPORTER_BINARY} + + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d + ${MKDIR} ${STAGEDIR}${PREFIX}/etc/syslog.d + + ${INSTALL_DATA} \ + ${WRKDIR}/newsyslog.conf \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/${PORTNAME}.conf + + ${INSTALL_DATA} \ + ${WRKDIR}/syslog.d.conf \ + ${STAGEDIR}${PREFIX}/etc/syslog.d/${PORTNAME}.conf + +.include Property changes on: www/nginx-vts-exporter/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1,2 ## +FreeBSD=%H +\ No newline at end of property \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: www/nginx-vts-exporter/distinfo =================================================================== --- www/nginx-vts-exporter/distinfo (nonexistent) +++ www/nginx-vts-exporter/distinfo (working copy) @@ -0,0 +1,6 @@ +TIMESTAMP = 1575626942 +SHA256 (hnlq715-nginx-vts-exporter-v0.10.3_GH0.tar.gz) = a07e0a6170ac490f96a8e505795dcbfa0233976cf1efd36057014cff49622d95 +SIZE (hnlq715-nginx-vts-exporter-v0.10.3_GH0.tar.gz) = 149578 +TIMESTAMP = 1575626942 +SHA256 (hnlq715-nginx-vts-exporter-v0.10.3_GH0.tar.gz) = a07e0a6170ac490f96a8e505795dcbfa0233976cf1efd36057014cff49622d95 +SIZE (hnlq715-nginx-vts-exporter-v0.10.3_GH0.tar.gz) = 149578 Property changes on: www/nginx-vts-exporter/distinfo ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1,2 ## +yes +\ No newline at end of property \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: www/nginx-vts-exporter/files/newsyslog.conf.in =================================================================== --- www/nginx-vts-exporter/files/newsyslog.conf.in (nonexistent) +++ www/nginx-vts-exporter/files/newsyslog.conf.in (working copy) @@ -0,0 +1,8 @@ +# newsyslog(8) file for net-mgmt/nginx-vts-exporter +# See newsyslog.conf(5) for details. + +%%NGINX_VTS_EXPORTER_LOG_FILE%% 640 7 * @T00 JC +# newsyslog(8) file for net-mgmt/nginx-vts-exporter +# See newsyslog.conf(5) for details. + +%%NGINX_VTS_EXPORTER_LOG_FILE%% 640 7 * @T00 JC Property changes on: www/nginx-vts-exporter/files/newsyslog.conf.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: www/nginx-vts-exporter/files/nginx_vts_exporter.in =================================================================== --- www/nginx-vts-exporter/files/nginx_vts_exporter.in (nonexistent) +++ www/nginx-vts-exporter/files/nginx_vts_exporter.in (working copy) @@ -0,0 +1,104 @@ +#!/bin/sh + +# PROVIDE: nginx_vts_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# nginx_vts_exporter_enable (bool): Set to NO by default +# Set it to YES to enable nginx-vts-exporter +# nginx_vts_exporter_user (string): Set user to run nginx-vts-exporter +# Default is "nobody" +# nginx_vts_exporter_group (string): Set group to run nginx-vts-exporter +# Default is "nobody" +# nginx_vts_exporter_args (string): Set additional command line arguments +# Default is "" +# + +. /etc/rc.subr + +name=nginx_vts_exporter +rcvar=nginx_vts_exporter_enable + +load_rc_config $name + +: ${nginx_vts_exporter_enable:="NO"} +: ${nginx_vts_exporter_user:="nobody"} +: ${nginx_vts_exporter_group:="nobody"} +: ${nginx_vts_exporter_args:=""} + +pidfile="/var/run/${name}.pid" +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/${name}" +command_args="-p ${pidfile} -m 3 -T ${name} \ + /usr/bin/env ${procname} \ + ${nginx_vts_exporter_args}" + +start_precmd=nginx_vts_exporter_startprecmd + +nginx_vts_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install \ + -o ${nginx_vts_exporter_user} \ + -g ${nginx_vts_exporter_group} \ + /dev/null ${pidfile}; + fi +} + +load_rc_config $name +run_rc_command "$1" +#!/bin/sh + +# PROVIDE: nginx_vts_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# nginx_vts_exporter_enable (bool): Set to NO by default +# Set it to YES to enable nginx-vts-exporter +# nginx_vts_exporter_user (string): Set user to run nginx-vts-exporter +# Default is "nobody" +# nginx_vts_exporter_group (string): Set group to run nginx-vts-exporter +# Default is "nobody" +# nginx_vts_exporter_args (string): Set additional command line arguments +# Default is "" +# + +. /etc/rc.subr + +name=nginx_vts_exporter +rcvar=nginx_vts_exporter_enable + +load_rc_config $name + +: ${nginx_vts_exporter_enable:="NO"} +: ${nginx_vts_exporter_user:="nobody"} +: ${nginx_vts_exporter_group:="nobody"} +: ${nginx_vts_exporter_args:=""} + +pidfile="/var/run/${name}.pid" +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/${name}" +command_args="-p ${pidfile} -m 3 -T ${name} \ + /usr/bin/env ${procname} \ + ${nginx_vts_exporter_args}" + +start_precmd=nginx_vts_exporter_startprecmd + +nginx_vts_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install \ + -o ${nginx_vts_exporter_user} \ + -g ${nginx_vts_exporter_group} \ + /dev/null ${pidfile}; + fi +} + +load_rc_config $name +run_rc_command "$1" Property changes on: www/nginx-vts-exporter/files/nginx_vts_exporter.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: www/nginx-vts-exporter/files/syslog.d.conf.in =================================================================== --- www/nginx-vts-exporter/files/syslog.d.conf.in (nonexistent) +++ www/nginx-vts-exporter/files/syslog.d.conf.in (working copy) @@ -0,0 +1,12 @@ +# syslogd(8) configuration file for net-mgmt/nginx-vts-exporter +# +# See syslog.conf(5) for details. + +!%%NGINX_VTS_EXPORTER_LOG_TAG%% +daemon.* %%NGINX_VTS_EXPORTER_LOG_FILE%% +# syslogd(8) configuration file for net-mgmt/nginx-vts-exporter +# +# See syslog.conf(5) for details. + +!%%NGINX_VTS_EXPORTER_LOG_TAG%% +daemon.* %%NGINX_VTS_EXPORTER_LOG_FILE%% Property changes on: www/nginx-vts-exporter/files/syslog.d.conf.in ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: www/nginx-vts-exporter/pkg-descr =================================================================== --- www/nginx-vts-exporter/pkg-descr (nonexistent) +++ www/nginx-vts-exporter/pkg-descr (working copy) @@ -0,0 +1,8 @@ +Simple server that scrapes Nginx vts stats and exports +them via HTTP for Prometheus consumption. + +WWW: https://github.com/hnlq715/nginx-vts-exporter +Simple server that scrapes Nginx vts stats and exports +them via HTTP for Prometheus consumption. + +WWW: https://github.com/hnlq715/nginx-vts-exporter Property changes on: www/nginx-vts-exporter/pkg-descr ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1,2 ## +yes +\ No newline at end of property \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: www/nginx-vts-exporter/pkg-message =================================================================== --- www/nginx-vts-exporter/pkg-message (nonexistent) +++ www/nginx-vts-exporter/pkg-message (working copy) @@ -0,0 +1,10 @@ +By default the exporter is passed no arguments and runs with its own defaults, +this means it expects to find Nginx VTS status at http://localhost/status. + +You may wish to reconfigure this by setting: +nginx_vts_exporter_args="-nginx.scrape_uri http://nginx/status/url" +By default the exporter is passed no arguments and runs with its own defaults, +this means it expects to find Nginx VTS status at http://localhost/status. + +You may wish to reconfigure this by setting: +nginx_vts_exporter_args="-nginx.scrape_uri http://nginx/status/url" Property changes on: www/nginx-vts-exporter/pkg-message ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1,2 ## +yes +\ No newline at end of property \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property