diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2017-10-12 20:30:34 +0200 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2017-10-12 20:30:34 +0200 |
commit | 65f668d31b913a03fa772432ee5755cb9e9c245d (patch) | |
tree | 5fd27909dda932174d54980c5e0f895048c21285 /net-analyzer | |
parent | net-analyzer/prometheus-snmp_exporter: Fix description (diff) | |
download | gentoo-65f668d31b913a03fa772432ee5755cb9e9c245d.tar.gz gentoo-65f668d31b913a03fa772432ee5755cb9e9c245d.tar.bz2 gentoo-65f668d31b913a03fa772432ee5755cb9e9c245d.zip |
net-analyzer/prometheus-blackbox_exporter: Initial version
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-blackbox_exporter/Manifest b/net-analyzer/prometheus-blackbox_exporter/Manifest new file mode 100644 index 000000000000..a9cb8e33c561 --- /dev/null +++ b/net-analyzer/prometheus-blackbox_exporter/Manifest @@ -0,0 +1 @@ +DIST prometheus-blackbox_exporter-0.10.0.tar.gz 530109 SHA256 fcadd04112bfd405c56011954bf225a72831d9c4ca4ef3fb5bfdb4107a225907 SHA512 497246b440b03b964c90f9bcf8ec1bca45c213bc4652ddb92c339b42586746b75a5145e87899381718ba628891faae3dfae39b0196272f572c7213e94ea7295b WHIRLPOOL 73ae4c5d5b1ed14e1f33157b56085f739c3a4078f605caf8798b1783a37fde342a6874b8a9fa0a71854f92511890c7ebbdb39433a2d6b0c701e29c61bccb1299 diff --git a/net-analyzer/prometheus-blackbox_exporter/files/prometheus-blackbox_exporter.confd b/net-analyzer/prometheus-blackbox_exporter/files/prometheus-blackbox_exporter.confd new file mode 100644 index 000000000000..39887477dff9 --- /dev/null +++ b/net-analyzer/prometheus-blackbox_exporter/files/prometheus-blackbox_exporter.confd @@ -0,0 +1,2 @@ +# arguments for prometheus blackbox exporter +command_args="--config.file=/etc/blackbox_exporter/blackbox.yml" diff --git a/net-analyzer/prometheus-blackbox_exporter/files/prometheus-blackbox_exporter.initd b/net-analyzer/prometheus-blackbox_exporter/files/prometheus-blackbox_exporter.initd new file mode 100644 index 000000000000..45da799723d1 --- /dev/null +++ b/net-analyzer/prometheus-blackbox_exporter/files/prometheus-blackbox_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 blackbox exporter" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/blackbox_exporter" +command_args="${command_args:--config.file=/etc/blackbox_exporter/blackbox.yml}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/blackbox_exporter/${RC_SVCNAME}.log \ + --stderr /var/log/blackbox_exporter/${RC_SVCNAME}.log" + +depend() { + after net +} diff --git a/net-analyzer/prometheus-blackbox_exporter/metadata.xml b/net-analyzer/prometheus-blackbox_exporter/metadata.xml new file mode 100644 index 000000000000..5d0a20fee17b --- /dev/null +++ b/net-analyzer/prometheus-blackbox_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/blackbox_exporter</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-analyzer/prometheus-blackbox_exporter/prometheus-blackbox_exporter-0.10.0.ebuild b/net-analyzer/prometheus-blackbox_exporter/prometheus-blackbox_exporter-0.10.0.ebuild new file mode 100644 index 000000000000..c5cf528c542b --- /dev/null +++ b/net-analyzer/prometheus-blackbox_exporter/prometheus-blackbox_exporter-0.10.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/blackbox_exporter" +EGIT_COMMIT="v${PV/_rc/-rc.}" +BLACKBOX_EXPORTER_COMMIT="75681e3" +ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +DESCRIPTION="Prometheus exporter for blackbox probing via HTTP, HTTPS, DNS, TCP and ICMP" +HOMEPAGE="https://github.com/prometheus/blackbox_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}}/${BLACBOX_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 blackbox_exporter || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin blackbox_exporter/blackbox_exporter + dodoc {README,CONFIGURATION}.md blackbox.yml + insinto /etc/blackbox_exporter + newins example.yml blackbox.yml.example + popd || die + keepdir /var/lib/blackbox_exporter /var/log/blackbox_exporter + fowners ${PN}:${PN} /var/lib/blackbox_exporter /var/log/blackbox_exporter + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} |