diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2017-10-12 20:08:12 +0200 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2017-10-12 20:08:12 +0200 |
commit | 354cc09a85ef30ef2abf3879fdf986860dc35e3d (patch) | |
tree | 03cda2bd288bbc3765109e8ab8c6abf89571c553 /net-analyzer | |
parent | kde-plasma/kwin: Add missing patch (diff) | |
download | gentoo-354cc09a85ef30ef2abf3879fdf986860dc35e3d.tar.gz gentoo-354cc09a85ef30ef2abf3879fdf986860dc35e3d.tar.bz2 gentoo-354cc09a85ef30ef2abf3879fdf986860dc35e3d.zip |
net-analyzer/prometheus-snmp_exporter: Initial commit
Package-Manager: Portage-2.3.11, Repoman-2.3.3
Diffstat (limited to 'net-analyzer')
5 files changed, 83 insertions, 0 deletions
diff --git a/net-analyzer/prometheus-snmp_exporter/Manifest b/net-analyzer/prometheus-snmp_exporter/Manifest new file mode 100644 index 000000000000..cba6bc622a0d --- /dev/null +++ b/net-analyzer/prometheus-snmp_exporter/Manifest @@ -0,0 +1 @@ +DIST prometheus-snmp_exporter-0.7.0.tar.gz 3250164 SHA256 da9d0c4baa21a317a88ebbb0e836a4665614d03421d2c4ecb7df7e5217920398 SHA512 b0564fcd38eb823d136b25c3aa4e8f1df495eb6f262f105e6686adab80a794cd2cc47f51f40606aa4b51d29e0ab6851216b147b37e406e450b4f9559caaee5d1 WHIRLPOOL a0c4a7e53cc24ea712f681440be5757c40f7585037fa8a7f1e71da7aee2fb1a4084d2648e3b0076c452f7740657b710d9eb986b1e97e8b5bf44b04617d2c3405 diff --git a/net-analyzer/prometheus-snmp_exporter/files/prometheus-snmp_exporter.confd b/net-analyzer/prometheus-snmp_exporter/files/prometheus-snmp_exporter.confd new file mode 100644 index 000000000000..e80d6a1a8504 --- /dev/null +++ b/net-analyzer/prometheus-snmp_exporter/files/prometheus-snmp_exporter.confd @@ -0,0 +1,2 @@ +# arguments for prometheus snmp exporter +command_args="--config-file=/etc/snmp_exporter/snmp.yml" diff --git a/net-analyzer/prometheus-snmp_exporter/files/prometheus-snmp_exporter.initd b/net-analyzer/prometheus-snmp_exporter/files/prometheus-snmp_exporter.initd new file mode 100644 index 000000000000..4d620b54b171 --- /dev/null +++ b/net-analyzer/prometheus-snmp_exporter/files/prometheus-snmp_exporter.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 snmp exporter" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/snmp_exporter" +command_args="${command_args:---config-file=/etc/snmp_exporter/snmp.yml}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/snmp_exporter/${RC_SVCNAME}.log \ + --stderr /var/log/snmp_exporter/${RC_SVCNAME}.log" + +depend() { + after net +} diff --git a/net-analyzer/prometheus-snmp_exporter/metadata.xml b/net-analyzer/prometheus-snmp_exporter/metadata.xml new file mode 100644 index 000000000000..7391ccfbbae0 --- /dev/null +++ b/net-analyzer/prometheus-snmp_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/prometheus-snmp_exporter</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-analyzer/prometheus-snmp_exporter/prometheus-snmp_exporter-0.7.0.ebuild b/net-analyzer/prometheus-snmp_exporter/prometheus-snmp_exporter-0.7.0.ebuild new file mode 100644 index 000000000000..747c37de3559 --- /dev/null +++ b/net-analyzer/prometheus-snmp_exporter/prometheus-snmp_exporter-0.7.0.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2017 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/snmp_exporter" +EGIT_COMMIT="v${PV/_rc/-rc.}" +SNMP_EXPORTER_COMMIT="9147920" +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/snmp_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}}/${SNMP_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 snmp_exporter || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin snmp_exporter/snmp_exporter + dodoc {README,CHANGELOG,CONTRIBUTING}.md + insinto /etc/snmp_exporter + doins snmp.yml + popd || die + keepdir /var/lib/snmp_exporter /var/log/snmp_exporter + fowners ${PN}:${PN} /var/lib/snmp_exporter /var/log/snmp_exporter + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} |