diff options
Diffstat (limited to 'net-analyzer/prometheus-snmp_exporter')
5 files changed, 87 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..141334e57a07 --- /dev/null +++ b/net-analyzer/prometheus-snmp_exporter/Manifest @@ -0,0 +1,5 @@ +AUX prometheus-snmp_exporter.confd 98 SHA256 35a4150f56c8f898af0a28c92d9770df35ea30c8d3c59e1e63075c458b3b8ced SHA512 027ff624a0e5faae571e36cf0fdf860e13956976878a7b3ca2afbf5e6387ecb02d391974cf7c44c33468d34a16cf00d10ee153f3b7507b9cc5a62126b70c5a39 WHIRLPOOL 55fbeb2c15a17a8e588a51e6aad1b56a7bc6eaff278b070eba7dc953928843d73df0eb4b2c6e4fc079436be486949a0abfbdfa0e8503c90ad58fcf2ce3d42976 +AUX prometheus-snmp_exporter.initd 591 SHA256 5ed292deb2cd07181328c0cd520dec77e496b5b4237b1c8e9e8ba15277633406 SHA512 0e53ef6790dc60091c0ed3b9cb7f47fabf526db80f9f09e212880efff59e9c0b3abb19235fe9b82da15cfb8aacb1eab326902f51d4908af80348023ae59bd474 WHIRLPOOL 71e7fcbed414e4f93e408441c07748c3640385c54bbf09de25cb796c2e74b86abe9fecb49f827308c15d2a0780d6f3201ba9b0a9e0c92969fcf759b453bfc14e +DIST prometheus-snmp_exporter-0.7.0.tar.gz 3250164 SHA256 da9d0c4baa21a317a88ebbb0e836a4665614d03421d2c4ecb7df7e5217920398 SHA512 b0564fcd38eb823d136b25c3aa4e8f1df495eb6f262f105e6686adab80a794cd2cc47f51f40606aa4b51d29e0ab6851216b147b37e406e450b4f9559caaee5d1 WHIRLPOOL a0c4a7e53cc24ea712f681440be5757c40f7585037fa8a7f1e71da7aee2fb1a4084d2648e3b0076c452f7740657b710d9eb986b1e97e8b5bf44b04617d2c3405 +EBUILD prometheus-snmp_exporter-0.7.0.ebuild 1283 SHA256 92190559f5197ec3082cc888d347a4f4cd3a93718dd805aa287c2eae3565d76e SHA512 f4ed186384e0521a3e3469c20a57b5282f51100c37c6033b519e46db8dcf1f2bcbefe2bddb140ff9f91728735ad108d1fd5a198aa3ee70c480826bb6fe2cf9c2 WHIRLPOOL 73afd775aead561d35b552d6c131f6e5316310949a6c7bf5ec60f7ee22c10e5d4e5ceeceec75b444777565c3e3a674ea00485fdb34193852c2d1e9b93a3e8773 +MISC metadata.xml 334 SHA256 42c6c31707ac483f87eb5d8605184dd2ea3d28f4e01b62b85ab018a1e1a69e7b SHA512 7fd3e4314022bf2ff86bd01f335d5c4402676970b9810575225aff3d40bd5bdc9ffc27b438c880dc0a665cf3873502b969dfb30644b3c106278fd353820d6599 WHIRLPOOL 1e769a6d9c4c8147f2f1d5b3e30f0c37e94db7f526828da6f1a1697ed8511e90a5541027c42976804c2071027fc65b9a044dac4480319283d1975a9d72d3e146 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..9ea37fba673a --- /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/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..15ca77ed1b70 --- /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 snmp 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 + newins snmp.yml snmp.yml.example + 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} +} |