File tree 2 files changed +68
-0
lines changed
app-metrics/node_exporter
2 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /sbin/openrc-run
2
+ # Copyright 2016-2017 Gentoo Foundation
3
+ # Distributed under the terms of the GNU General Public License v2
4
+
5
+ description=" Prometheus machine metrics exporter"
6
+ pidfile=${pidfile:- " /run/${RC_SVCNAME} .pid" }
7
+ user=${user:- ${RC_SVCNAME} }
8
+ group=${group:- ${RC_SVCNAME} }
9
+
10
+ command=" /usr/sbin/node_exporter"
11
+ command_args=" ${command_args:- --collector.textfile.directory=/ var/ lib/ node_exporter/ } "
12
+ command_background=" true"
13
+ start_stop_daemon_args=" --user ${user} --group ${group} \
14
+ --stdout /var/log/node_exporter/${RC_SVCNAME} .log \
15
+ --stderr /var/log/node_exporter/${RC_SVCNAME} .log"
16
+
17
+ depend () {
18
+ after net
19
+ }
20
+
21
+ start_pre () {
22
+ checkpath -q -d -m 0755 -o ${user} :${group} /var/log/node_exporter
23
+ }
Original file line number Diff line number Diff line change
1
+ # Copyright 1999-2020 Gentoo Authors
2
+ # Distributed under the terms of the GNU General Public License v2
3
+
4
+ EAPI=7
5
+ inherit go-module systemd
6
+ MY_PV=" v${PV/ _rc/ -rc.} "
7
+ NODE_EXPORTER_COMMIT=ef7c058
8
+
9
+ DESCRIPTION=" Prometheus exporter for machine metrics"
10
+ HOMEPAGE=" https://github.com/prometheus/node_exporter"
11
+ SRC_URI=" https://github.com/prometheus/node_exporter/archive/${MY_PV} .tar.gz -> ${P} .tar.gz"
12
+
13
+ LICENSE=" Apache-2.0 BSD BSD-2 MIT"
14
+ SLOT=" 0"
15
+ KEYWORDS=" ~amd64"
16
+
17
+ CDEPEND=" acct-group/node_exporter
18
+ acct-user/node_exporter"
19
+ DEPEND=" >=dev-util/promu-0.3.0
20
+ ${CDEPEND} "
21
+ RDEPEND=" ${CDEPEND} "
22
+
23
+ S=" ${WORKDIR} /${PN} -${PV/ _rc/ -rc.} "
24
+
25
+ src_prepare () {
26
+ default
27
+ sed -i -e " s/{{.Revision}}/${NODE_EXPORTER_COMMIT} /" .promu.yml || die
28
+ }
29
+
30
+ src_compile () {
31
+ mkdir -p bin || die
32
+ promu build -v --prefix node_exporter || die
33
+ }
34
+
35
+ src_install () {
36
+ dosbin node_exporter/node_exporter
37
+ dodoc {README,CHANGELOG,CONTRIBUTING}.md
38
+ systemd_dounit examples/systemd/node_exporter.service
39
+ insinto /etc/sysconfig
40
+ newins examples/systemd/sysconfig.node_exporter node_exporter
41
+ newinitd " ${FILESDIR} " /${PN} .initd ${PN}
42
+ newconfd " ${FILESDIR} " /${PN} .confd ${PN}
43
+ keepdir /var/lib/node_exporter /var/log/node_exporter
44
+ fowners ${PN} :${PN} /var/lib/node_exporter /var/log/node_exporter
45
+ }
You can’t perform that action at this time.
0 commit comments