Skip to content

Commit

Permalink
app-metrics/ceph_exporter: initial import
Browse files Browse the repository at this point in the history
Signed-off-by: William Hubbs <[email protected]>
  • Loading branch information
williamh committed May 5, 2022
1 parent 9a50969 commit b1f8f72
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app-metrics/ceph_exporter/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DIST ceph_exporter-4.0.1-deps.tar.xz 7402752 BLAKE2B 4619eba4c1630cd683193fec8f449698587dc8d17c26992e033fa7495934de26bcca84fac4ac174e25e7f405c27033fc324703748cac59f90b6e58c2548f8cd2 SHA512 893a6d246c640647ac55f5f32d657cbd80bec3c9404e1484e6188e4e045a20d01d50559723105f179d438019f66d904938a24ce164f85a41631930067d92f7ba
DIST ceph_exporter-4.0.1.tar.gz 143653 BLAKE2B 2a8c907fb5ff06bc629644aab94b450646f6b25ff057d2b01485f0131cef3e64e3b159f029f29cf78c8d6b450ff9b750858799fe079256509e31e5b8bcf3e012 SHA512 154e75cc397635450d2b99e5e56c829fd5816e9aad95707eff42500ce21fd92a6d12772a58530b580b8e14e5db7c32d2d24f395175f414df9d89fbcbb8239ece
35 changes: 35 additions & 0 deletions app-metrics/ceph_exporter/ceph_exporter-4.0.1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
inherit go-module

DESCRIPTION="Prometheus exporter that scrapes metrics from a ceph cluster"
HOMEPAGE="https://github.com/digitalocean/ceph_exporter"
SRC_URI="https://github.com/digitalocean/ceph_exporter/archive/${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
acct-group/ceph
acct-user/ceph
=sys-cluster/ceph-16*
"
DEPEND="${RDEPEND}"
BDEPEND=">=dev-lang/go-1.18"

src_compile() {
go build -o bin/ceph_exporter || die
}

src_install() {
dobin bin/ceph_exporter
dodoc {README,CONTRIBUTING}.md exporter.yml
newconfd "${FILESDIR}"/${PN}.confd ${PN}
newinitd "${FILESDIR}"/${PN}.initd ${PN}
keepdir /var/lib/ceph_exporter /var/log/ceph_exporter
fowners ceph:ceph /var/lib/ceph_exporter /var/log/ceph_exporter
}
2 changes: 2 additions & 0 deletions app-metrics/ceph_exporter/files/ceph_exporter.confd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# arguments for ceph exporter
# command_args=""
25 changes: 25 additions & 0 deletions app-metrics/ceph_exporter/files/ceph_exporter.initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/sbin/openrc-run
# Copyright 2016-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="Prometheus ceph metrics exporter"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-ceph}
group=${group:-ceph}

command="/usr/bin/ceph_exporter"
command_background="true"
output_log="/var/log/ceph_exporter/${RC_SVCNAME}.log"
error_log="/var/log/ceph_exporter/${RC_SVCNAME}.log"
start_stop_daemon_args="--user ${user} --group ${group}"

depend() {
after net
}

start_pre() {
if [ ! -f "/etc/ceph/ceph.${user}.keyring" ]; then
eerror "keyring not found, exporter won't be able to connect to the cluster!"
exit 1
fi
}
8 changes: 8 additions & 0 deletions app-metrics/ceph_exporter/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>[email protected]</email>
<name>William Hubbs</name>
</maintainer>
</pkgmetadata>

0 comments on commit b1f8f72

Please sign in to comment.