diff options
author | dakkar <dakkar@thenautilus.net> | 2025-02-14 18:41:09 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2025-02-14 18:41:09 +0000 |
commit | 465296e20c0ba95e05882242c69f04c342818ef5 (patch) | |
tree | c9a68614c94681cc326945254d00dfc0415aa15d | |
parent | probably correct pgroonga ebuild (diff) | |
download | gentoo-overlay-465296e20c0ba95e05882242c69f04c342818ef5.tar.gz gentoo-overlay-465296e20c0ba95e05882242c69f04c342818ef5.tar.bz2 gentoo-overlay-465296e20c0ba95e05882242c69f04c342818ef5.zip |
smartctl_exporter 0.13
this supports megaraid properly
6 files changed, 96 insertions, 0 deletions
diff --git a/app-metrics/smartctl_exporter/Manifest b/app-metrics/smartctl_exporter/Manifest new file mode 100644 index 0000000..86a4192 --- /dev/null +++ b/app-metrics/smartctl_exporter/Manifest @@ -0,0 +1,7 @@ +AUX smartctl_exporter.confd 50 BLAKE2B 688a7d5198a13901ff9e8559ece3d7cb43f3d1360e9388975c95a3bb79f0e686f00fce282bb68e850715e476b0bc4ab3946e5e3446b1c8d38484921f8059e24b SHA512 a8da2186192f733d6edaf77dab8287b4f9927cf2b98dc43dadc443882372d9f206b6abe83c747d460b3097395f64d3c007f6d6a004ac7070eefef30131492e13 +AUX smartctl_exporter.initd 586 BLAKE2B 36201fc557ff2fee24459d8ab5dadb61df83e70c1ee5862fc77d41f57c445463e2bc63a15fcb59f7f1ae91d9102314bcf5257fc4a22f85d0150024d53339a5f5 SHA512 605b342a7d1710aac11787933195c1d7a66ccdd1d499df77ef0e0b8397efdddb999ca3594ce595835cfabd3cf141e749df4f4659299c632473f80377b6a40b17 +AUX smartctl_exporter.service 622 BLAKE2B 28a97f2d4a2aa2956eb30001c85bf8dffb5567db7f386a897e2007aed5794177acc100e00628f7355727d2d49bee4696a7f6a303b9f827567cac9caa5a6de9b8 SHA512 2f682520b7bb99b488c9859fdf71451eadbdb18a9fb47a175fc1a4978f8573fdfb962235371e5452f2c6184661abf12f970486d8c35567f110447add7bf4f94f +DIST smartctl_exporter-0.13.0-vendor.tar.xz 1445840 BLAKE2B af8a628e7f00a8520d12dfcb982fc33eb8f3b2edc10715c7bd5f2092b373a0a9ac68695f2b0fbe08aa5ad2c6569d2358f23e7ec50405ddc7d226b4d8fc2f4256 SHA512 da19182eb59aaa54240fcfa9bed4aa0cef73c14823b70d2cd752a5ee49bfd4baf18449a03301b665c06647da367998f6a66a606081bddffec480cd90f650201f +DIST smartctl_exporter-0.13.0.tar.gz 96075 BLAKE2B 3ed833c9930cf28bccd79d2622d40b4f55750cc73e69c41899d717baa471340658a7f0ac7eac2b20095395610021567c4bfec1efd29f3e271216f5986aff133c SHA512 1925da0329f47f439a746d4678687a02f82b9d363bc9a94c8b93065d14bc86a8f1fadf411635b27373ffab920fa876bbba83eab8889734e71968a46b53e41387 +EBUILD smartctl_exporter-0.13.0.ebuild 798 BLAKE2B 5fedbb9a09f5f41a61846449eb178e608a190ec5f4cac3f2036dadda5b96446680eb0d60aee29083190d183b93e5e42979c610522aa088c9bc1e85dd47f92c71 SHA512 2e9e9105138056307fdc141b28cfa7b1d4a0f3e12abf4f384ad180c922c2ec7eb8ae76997483b32f4371026b0dd7d48115b3eab284aafe02ead8d169499d912f +MISC metadata.xml 322 BLAKE2B 067be01a985da3e1d0126a95004d71e9638901bb5f0c2d7ab0c49896434fc2190ae2723bc1c463592a08cec887bca884138e79de847b475d8c7f847f2a22518d SHA512 faaab61fcb4237332a853c8851dd46569e90b9845f8761f9e003d826faab13b76dff55a6a66868ec53ab1b5247b94bf74e86f725a6f16a2652c1408359debdf1 diff --git a/app-metrics/smartctl_exporter/files/smartctl_exporter.confd b/app-metrics/smartctl_exporter/files/smartctl_exporter.confd new file mode 100644 index 0000000..5a8a1d6 --- /dev/null +++ b/app-metrics/smartctl_exporter/files/smartctl_exporter.confd @@ -0,0 +1,2 @@ +# arguments for smartctl exporter +command_args="" diff --git a/app-metrics/smartctl_exporter/files/smartctl_exporter.initd b/app-metrics/smartctl_exporter/files/smartctl_exporter.initd new file mode 100644 index 0000000..b9e18a6 --- /dev/null +++ b/app-metrics/smartctl_exporter/files/smartctl_exporter.initd @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 2016-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +description="smartctl metrics exporter" +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=root +group=root + +command="/usr/bin/smartctl_exporter" +command_args="${command_args}" +command_background="true" +command_user="${user}:${group}" +output_log="/var/log/smartctl_exporter/${RC_SVCNAME}.log" +error_log="/var/log/smartctl_exporter/${RC_SVCNAME}.log" + +depend() { + after net +} + +start_pre() { + checkpath -q -d -m 0755 -o ${user}:${group} /var/log/smartctl_exporter +} diff --git a/app-metrics/smartctl_exporter/files/smartctl_exporter.service b/app-metrics/smartctl_exporter/files/smartctl_exporter.service new file mode 100644 index 0000000..c21aa5a --- /dev/null +++ b/app-metrics/smartctl_exporter/files/smartctl_exporter.service @@ -0,0 +1,22 @@ +[Unit] +Description=smartctl exporter +Documentation=https://github.com/prometheus-community/smartctl_exporter +After=network-online.target + +[Service] +# Security improvements required in future, but needs care; ideally +# smartctl_exporter runs minimal privilege, but can invoke smartctl via sudo to +# touch disks. +# https://github.com/prometheus-community/smartctl_exporter/issues/146 +User=root +Group=root +Restart=on-failure +Type=exec +# TODO: find a good way to add args here +ExecStart=/usr/sbin/smartctl_exporter +ExecReload=/usr/bin/kill -HUP $MAINPID +TimeoutStopSec=20s +SendSIGKILL=no + +[Install] +WantedBy=multi-user.target diff --git a/app-metrics/smartctl_exporter/metadata.xml b/app-metrics/smartctl_exporter/metadata.xml new file mode 100644 index 0000000..ec7f20a --- /dev/null +++ b/app-metrics/smartctl_exporter/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>robbat2@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="github">prometheus-community/smartctl_exporter</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-metrics/smartctl_exporter/smartctl_exporter-0.13.0.ebuild b/app-metrics/smartctl_exporter/smartctl_exporter-0.13.0.ebuild new file mode 100644 index 0000000..398b3b6 --- /dev/null +++ b/app-metrics/smartctl_exporter/smartctl_exporter-0.13.0.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 +inherit go-module systemd + +DESCRIPTION="Export smartctl statistics to prometheus" +HOMEPAGE="https://github.com/prometheus-community/smartctl_exporter" + +SRC_URI=" + ${HOMEPAGE}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://www.thenautilus.net/gentoo-tarballs/smartctl_exporter-0.13.0-vendor.tar.xz + " +RESTRICT="mirror" +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +BDEPEND="dev-util/promu" +DEPEND="dev-lang/go" +RDEPEND="sys-apps/smartmontools" + +src_compile() { + emake build PROMU='/usr/bin/promu' +} + +src_install() { + dodoc *.md + dobin ${PN} + newinitd "${FILESDIR}"/${PN}.initd ${PN} + newconfd "${FILESDIR}"/${PN}.confd ${PN} + systemd_dounit "${FILESDIR}/${PN}.service" +} |