From 616a092a12981d23eb9cc1490739c22d5c634230 Mon Sep 17 00:00:00 2001 From: Toyam Cox Date: Fri, 8 Sep 2017 02:58:33 -0400 Subject: [PATCH] New package: node_exporter-0.14.0 --- srcpkgs/node_exporter/files/node_exporter/run | 12 ++++++++ srcpkgs/node_exporter/template | 28 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 srcpkgs/node_exporter/files/node_exporter/run create mode 100644 srcpkgs/node_exporter/template diff --git a/srcpkgs/node_exporter/files/node_exporter/run b/srcpkgs/node_exporter/files/node_exporter/run new file mode 100755 index 00000000000..8f78e02beb8 --- /dev/null +++ b/srcpkgs/node_exporter/files/node_exporter/run @@ -0,0 +1,12 @@ +#!/bin/sh + +# Add $ARGS for more arguments to node_exporter +[ -f ./conf ] && . ./conf + +: ${USER:=_node_exporter} +: ${RUNIT_COLLECTOR:='-collector.runit.servicedir /var/service'} +[ -n "$LISTEN_ADDR" ] && LISTEN_ADDR="-web.listen-address ${LISTEN_ADDR}" +# The below must match upstream's default enabled collectors, and because we can, we add 'runit' +: ${ENABLED_MODS:='conntrack,diskstats,entropy,edac,filefd,filesystem,hwmon,infiniband,loadavg,mdadm,meminfo,netdev,netstat,sockstat,stat,textfile,time,uname,vmstat,wifi,zfs,runit'} + +exec chpst -u $USER node_exporter -collectors.enabled ${ENABLED_MODS} ${RUNIT_COLLECTOR} ${LISTEN_ADDR} ${ARGS} diff --git a/srcpkgs/node_exporter/template b/srcpkgs/node_exporter/template new file mode 100644 index 00000000000..42ae2b1f413 --- /dev/null +++ b/srcpkgs/node_exporter/template @@ -0,0 +1,28 @@ +# Template file for 'node_exporter' +# ON UPDATE: Be sure to update the default list of collectors in the sv run +# file. There is no easy way at 0.14.0 to go from the -h output +# of node_exporter to taking the default list and appending runit. +pkgname=node_exporter +version=0.14.0 +revision=1 +build_style=go +go_import_path="github.com/prometheus/node_exporter" +go_ldflags="-X ${go_import_path}/version.Version=${version} + -X ${go_import_path}/version.Revision=${version} + -X ${go_import_path}/version.Branch=${version} + -X ${go_import_path}/version.BuildUser=VoidLinux" +short_desc="Exporter for machine metrics" +maintainer="Toyam Cox " +license="Apache-2.0" +homepage="https://prometheus.io/" +distfiles="https://github.com/prometheus/node_exporter/archive/v${version}.tar.gz" +checksum=312d7e1c07d6a7548f2f116b983da87f7b3a7630f9332eb41c306fd71b2e6ec1 + +system_accounts="_node_exporter" + +post_install() { + vmkdir usr/share/examples/$pkgname + vcopy text_collector_examples usr/share/examples/$pkgname + vsconf example.rules + vsv node_exporter +}