Date: Sat, 15 Oct 2016 05:24:29 +0000 (UTC) From: Kurt Jaeger <pi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r424002 - in head/sysutils: . node_exporter node_exporter/files Message-ID: <201610150524.u9F5OTlU068831@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pi Date: Sat Oct 15 05:24:29 2016 New Revision: 424002 URL: https://svnweb.freebsd.org/changeset/ports/424002 Log: New port: sysutils/node_exporter node_exporter is a prometheus exporter for machine metrics, written in Go with pluggable metric collectors. WWW: https://github.com/prometheus/node_exporter PR: 212467 Submitted by: Jev Bjoersell <jev@ecadlabs.com> Added: head/sysutils/node_exporter/ head/sysutils/node_exporter/Makefile (contents, props changed) head/sysutils/node_exporter/distinfo (contents, props changed) head/sysutils/node_exporter/files/ head/sysutils/node_exporter/files/node_exporter.in (contents, props changed) head/sysutils/node_exporter/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sat Oct 15 05:09:11 2016 (r424001) +++ head/sysutils/Makefile Sat Oct 15 05:24:29 2016 (r424002) @@ -648,6 +648,7 @@ SUBDIR += nfsping SUBDIR += nitrogen SUBDIR += no-login + SUBDIR += node_exporter SUBDIR += nomad SUBDIR += npadmin SUBDIR += nrg2iso Added: head/sysutils/node_exporter/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/node_exporter/Makefile Sat Oct 15 05:24:29 2016 (r424002) @@ -0,0 +1,30 @@ +# Created by: Jev Björsell <ports@ecadlabs.com> +# $FreeBSD$ + +PORTNAME= node_exporter +PORTVERSION= 0.12.0 +CATEGORIES= sysutils + +MAINTAINER= ports@ecadlabs.com +COMMENT= Prometheus exporter for machine metrics + +LICENSE= APACHE20 + +USES= go +USE_GITHUB= yes + +GH_ACCOUNT= prometheus + +GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} +GO_TARGET= github.com/${GH_ACCOUNT}/${PORTNAME} + +PLIST_FILES= bin/node_exporter + +USE_RC_SUBR= node_exporter + +STRIP= # stripping can break go binaries + +do-install: + ${INSTALL_PROGRAM} ${WRKDIR}/bin/node_exporter ${STAGEDIR}${PREFIX}/bin + +.include <bsd.port.mk> Added: head/sysutils/node_exporter/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/node_exporter/distinfo Sat Oct 15 05:24:29 2016 (r424002) @@ -0,0 +1,3 @@ +TIMESTAMP = 1473276147 +SHA256 (prometheus-node_exporter-0.12.0_GH0.tar.gz) = 75e522aa29ec9bd0ea400517d1d556f1e5d0dfc9bc02d9406a1c6c426c80a508 +SIZE (prometheus-node_exporter-0.12.0_GH0.tar.gz) = 735286 Added: head/sysutils/node_exporter/files/node_exporter.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/node_exporter/files/node_exporter.in Sat Oct 15 05:24:29 2016 (r424002) @@ -0,0 +1,59 @@ +#!/bin/sh + +# PROVIDE: node_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# node_exporter_enable (bool): Set to NO by default. +# Set it to YES to enable node_exporter. +# node_exporter_user (string): Set user that node_exporter will run under +# Default is "nobody". +# node_exporter_group (string): Set group that node_exporter will run under +# Default is "nobody". +# node_exporter_args (string): Set extra arguments to pass to node_exporter +# Default is "". +# node_exporter_listen_address (string):Set ip:port that node_exporter will listen on +# Default is ":9100". +# node_exporter_textfile_dir (string): Set directory that node_exporter will watch +# Default is "/var/tmp/node_exporter". + +. /etc/rc.subr + +name=node_exporter +rcvar=node_exporter_enable + +load_rc_config $name + +: ${node_exporter_enable:="NO"} +: ${node_exporter_user:="nobody"} +: ${node_exporter_group:="nobody"} +: ${node_exporter_args:=""} +: ${node_exporter_listen_address:=":9100"} +: ${node_exporter_textfile_dir:="/var/tmp/node_exporter"} + + +pidfile=/var/run/node_exporter.pid +command="/usr/sbin/daemon" +procname="%%PREFIX%%/bin/node_exporter" +command_args="-p ${pidfile} /usr/bin/env ${procname} \ + -web.listen-address=${node_exporter_listen_address} \ + -collector.textfile.directory=${node_exporter_textfile_dir} \ + ${node_exporter_args}" + +start_precmd=node_exporter_startprecmd + +node_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${node_exporter_user} -g ${node_exporter_group} /dev/null ${pidfile}; + fi + if [ ! -d ${node_exporter_textfile_dir} ]; then + install -d -o ${node_exporter_user} -g ${node_exporter_group} -m 1755 ${node_exporter_textfile_dir} + fi +} + +load_rc_config $name +run_rc_command "$1" Added: head/sysutils/node_exporter/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/node_exporter/pkg-descr Sat Oct 15 05:24:29 2016 (r424002) @@ -0,0 +1,4 @@ +node_exporter is a prometheus exporter for machine metrics, written in Go +with pluggable metric collectors. + +WWW: https://github.com/prometheus/node_exporter
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610150524.u9F5OTlU068831>