diff options
author | Manuel Rüger <mrueg@gentoo.org> | 2018-02-27 20:17:32 +0100 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2018-02-27 20:17:32 +0100 |
commit | 7b47a7384b30d6800ffa80426e3d698a289ecd69 (patch) | |
tree | f02a4a039a5e6e9c80846c6f5c016cbfe8765a76 /app-admin/mongodb_exporter | |
parent | www-client/vivaldi: Old. (diff) | |
download | gentoo-7b47a7384b30d6800ffa80426e3d698a289ecd69.tar.gz gentoo-7b47a7384b30d6800ffa80426e3d698a289ecd69.tar.bz2 gentoo-7b47a7384b30d6800ffa80426e3d698a289ecd69.zip |
app-admin/mongodb_exporter: Initial version
Package-Manager: Portage-2.3.24, Repoman-2.3.6
Diffstat (limited to 'app-admin/mongodb_exporter')
-rw-r--r-- | app-admin/mongodb_exporter/Manifest | 1 | ||||
-rw-r--r-- | app-admin/mongodb_exporter/files/mongodb_exporter.confd | 2 | ||||
-rw-r--r-- | app-admin/mongodb_exporter/files/mongodb_exporter.initd | 19 | ||||
-rw-r--r-- | app-admin/mongodb_exporter/metadata.xml | 11 | ||||
-rw-r--r-- | app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild | 47 |
5 files changed, 80 insertions, 0 deletions
diff --git a/app-admin/mongodb_exporter/Manifest b/app-admin/mongodb_exporter/Manifest new file mode 100644 index 000000000000..ef9522c21836 --- /dev/null +++ b/app-admin/mongodb_exporter/Manifest @@ -0,0 +1 @@ +DIST mongodb_exporter-0.4.0.tar.gz 3386266 BLAKE2B a6bebada2792e620b2107b72b3ab8b2a4e7a08fc53747f266b30a3cf2fe42ed7e09e3be9aa36332cba2df124947064f545821f355726e09649509c671a56c30b SHA512 0db1abd8c7439239cf59b24968ef33f83c6609a9deaed250315dd7fcb6844ef3d0d0c1f50b979f931beb539038a13eb7b88c03c899333d981112695be2e031b3 diff --git a/app-admin/mongodb_exporter/files/mongodb_exporter.confd b/app-admin/mongodb_exporter/files/mongodb_exporter.confd new file mode 100644 index 000000000000..bd85fa288304 --- /dev/null +++ b/app-admin/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-admin/mongodb_exporter/files/mongodb_exporter.initd b/app-admin/mongodb_exporter/files/mongodb_exporter.initd new file mode 100644 index 000000000000..2a2c985c4f64 --- /dev/null +++ b/app-admin/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-admin/mongodb_exporter/metadata.xml b/app-admin/mongodb_exporter/metadata.xml new file mode 100644 index 000000000000..b54031048cbc --- /dev/null +++ b/app-admin/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-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild b/app-admin/mongodb_exporter/mongodb_exporter-0.4.0.ebuild new file mode 100644 index 000000000000..5ea07ecd61c8 --- /dev/null +++ b/app-admin/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} +} |