diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2018-03-27 13:09:11 +0200 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2018-03-27 13:09:11 +0200 |
commit | fb5fd0ca749a9a2b032ab1f7e1a9db729abb6c73 (patch) | |
tree | d1c8afeaa1ee9370adfc621fee2a9c40fe2eaec5 /app-metrics/mongodb_exporter | |
parent | app-admin/kube-bench: Remove old (diff) | |
download | gentoo-fb5fd0ca749a9a2b032ab1f7e1a9db729abb6c73.tar.gz gentoo-fb5fd0ca749a9a2b032ab1f7e1a9db729abb6c73.tar.bz2 gentoo-fb5fd0ca749a9a2b032ab1f7e1a9db729abb6c73.zip |
app-metrics/mongodb_exporter: Move package from app-admin/mongodb_exporter
Diffstat (limited to 'app-metrics/mongodb_exporter')
5 files changed, 80 insertions, 0 deletions
diff --git a/app-metrics/mongodb_exporter/Manifest b/app-metrics/mongodb_exporter/Manifest new file mode 100644 index 000000000000..ef9522c21836 --- /dev/null +++ b/app-metrics/mongodb_exporter/Manifest @@ -0,0 +1 @@ +DIST mongodb_exporter-0.4.0.tar.gz 3386266 BLAKE2B a6bebada2792e620b2107b72b3ab8b2a4e7a08fc53747f266b30a3cf2fe42ed7e09e3be9aa36332cba2df124947064f545821f355726e09649509c671a56c30b SHA512 0db1abd8c7439239cf59b24968ef33f83c6609a9deaed250315dd7fcb6844ef3d0d0c1f50b979f931beb539038a13eb7b88c03c899333d981112695be2e031b3 diff --git a/app-metrics/mongodb_exporter/files/mongodb_exporter.confd b/app-metrics/mongodb_exporter/files/mongodb_exporter.confd new file mode 100644 index 000000000000..bd85fa288304 --- /dev/null +++ b/app-metrics/mongodb_exporter/files/mongodb_exporter.confd @@ -0,0 +1,2 @@ +# arguments for prometheus mongodb exporter +command_args="-mongodb.uri=http://localhost:9200" diff --git a/app-metrics/mongodb_exporter/files/mongodb_exporter.initd b/app-metrics/mongodb_exporter/files/mongodb_exporter.initd new file mode 100644 index 000000000000..2a2c985c4f64 --- /dev/null +++ b/app-metrics/mongodb_exporter/files/mongodb_exporter.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 2016-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Prometheus MongoDB exporter" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} +group=${group:-${RC_SVCNAME}} + +command="/usr/bin/mongodb_exporter" +command_args="${command_args:--mongodb.uri=http://localhost:27017}" +command_background="true" +start_stop_daemon_args="--user ${user} --group ${group} \ + --stdout /var/log/elasticsearch_exporter/${RC_SVCNAME}.log \ + --stderr /var/log/elasticsearch_exporter/${RC_SVCNAME}.log" + +depend() { + after net +} diff --git a/app-metrics/mongodb_exporter/metadata.xml b/app-metrics/mongodb_exporter/metadata.xml new file mode 100644 index 000000000000..b54031048cbc --- /dev/null +++ b/app-metrics/mongodb_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">percona/mongodb_exporter</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-metrics/mongodb_exporter/mongodb_exporter-0.4.0.ebuild b/app-metrics/mongodb_exporter/mongodb_exporter-0.4.0.ebuild new file mode 100644 index 000000000000..5ea07ecd61c8 --- /dev/null +++ b/app-metrics/mongodb_exporter/mongodb_exporter-0.4.0.ebuild @@ -0,0 +1,47 @@ +# 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/percona/mongodb_exporter" +EXPORTER_COMMIT="01f0ef9" +ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" +KEYWORDS="~amd64" + +DESCRIPTION="Prometheus exporter for MongoDB" +HOMEPAGE="https://github.com/percona/mongodb_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$/d" -e "s/{{.Revision}}/${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 bin || die + popd || die +} + +src_install() { + pushd src/${EGO_PN} || die + dobin bin/mongodb_exporter + dodoc {README,CHANGELOG}.md + popd || die + keepdir /var/log/mongodb_exporter + fowners ${PN}:${PN} /var/log/mongodb_exporter + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} +} |