summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2018-03-30 16:27:17 +0200
committerManuel Rüger <mrueg@gentoo.org>2018-03-30 16:27:17 +0200
commitdc563fa90201774a58b7f4af4858bf4470cba892 (patch)
treeacde7938ebc396975f20717be0d53fff82c7dddd /app-metrics
parentapp-metrics/nginx-vts-exporter: Version bump to 0.10.3 (diff)
downloadgentoo-dc563fa90201774a58b7f4af4858bf4470cba892.tar.gz
gentoo-dc563fa90201774a58b7f4af4858bf4470cba892.tar.bz2
gentoo-dc563fa90201774a58b7f4af4858bf4470cba892.zip
app-metrics/node_exporter: Move package from net-analyzer/prometheus-node_exporter
Diffstat (limited to 'app-metrics')
-rw-r--r--app-metrics/node_exporter/Manifest1
-rw-r--r--app-metrics/node_exporter/files/node_exporter-1.initd19
-rw-r--r--app-metrics/node_exporter/files/node_exporter.confd2
-rw-r--r--app-metrics/node_exporter/metadata.xml11
-rw-r--r--app-metrics/node_exporter/node_exporter-0.15.2.ebuild48
5 files changed, 81 insertions, 0 deletions
diff --git a/app-metrics/node_exporter/Manifest b/app-metrics/node_exporter/Manifest
new file mode 100644
index 000000000000..12796da2f69d
--- /dev/null
+++ b/app-metrics/node_exporter/Manifest
@@ -0,0 +1 @@
+DIST prometheus-node_exporter-0.15.2.tar.gz 1327204 BLAKE2B ee694771ed6d736fd4bb6a10f713f31becc930fb8225499d4b3a2a2cc7416c1816605cd8f4205dc37a2264af8d9f85e3519bc01844d252b6a70d4ee5f6308ece SHA512 b39ce0801a5bf5a2a70c4034659d047d70b3763af3f18925b65c2b5f72832e261362aaeb9ce4c68cb7bf52e790d3fc710a6c8550ad7876e89fd9f5a055200a52
diff --git a/app-metrics/node_exporter/files/node_exporter-1.initd b/app-metrics/node_exporter/files/node_exporter-1.initd
new file mode 100644
index 000000000000..e8268e487d2d
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter-1.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2016-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Prometheus machine metrics exporter"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/node_exporter"
+command_args="${command_args:---collector.textfile.directory=/var/lib/node_exporter/}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+ --stdout /var/log/node_exporter/${RC_SVCNAME}.log \
+ --stderr /var/log/node_exporter/${RC_SVCNAME}.log"
+
+depend() {
+ after net
+}
diff --git a/app-metrics/node_exporter/files/node_exporter.confd b/app-metrics/node_exporter/files/node_exporter.confd
new file mode 100644
index 000000000000..b65652001308
--- /dev/null
+++ b/app-metrics/node_exporter/files/node_exporter.confd
@@ -0,0 +1,2 @@
+# arguments for prometheus node exporter
+command_args="--collector.textfile.directory=/var/lib/node_exporter/"
diff --git a/app-metrics/node_exporter/metadata.xml b/app-metrics/node_exporter/metadata.xml
new file mode 100644
index 000000000000..d758c8dfc417
--- /dev/null
+++ b/app-metrics/node_exporter/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">prometheus/node_exporter</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-metrics/node_exporter/node_exporter-0.15.2.ebuild b/app-metrics/node_exporter/node_exporter-0.15.2.ebuild
new file mode 100644
index 000000000000..c85ca942ce7c
--- /dev/null
+++ b/app-metrics/node_exporter/node_exporter-0.15.2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/prometheus/node_exporter"
+EGIT_COMMIT="v${PV/_rc/-rc.}"
+NODE_EXPORTER_COMMIT="98bc649"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="amd64"
+
+DESCRIPTION="Prometheus exporter for machine metrics"
+HOMEPAGE="https://github.com/prometheus/node_exporter"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+DEPEND="dev-util/promu"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ default
+ sed -i -e "s/{{.Revision}}/${NODE_EXPORTER_COMMIT}/" src/${EGO_PN}/.promu.yml || die
+}
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ mkdir -p bin || die
+ GOPATH="${S}" promu build -v --prefix node_exporter || die
+ popd || die
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ dobin node_exporter/node_exporter
+ dodoc {README,CHANGELOG,CONTRIBUTING}.md
+ popd || die
+ keepdir /var/lib/node_exporter /var/log/node_exporter
+ fowners ${PN}:${PN} /var/lib/node_exporter /var/log/node_exporter
+ newinitd "${FILESDIR}"/${PN}-1.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+}