Merge branch 'feature/postfix-exporter' of linux/gentoo-overlay into master

This commit is contained in:
Manuel Friedli 2019-11-19 17:01:47 +01:00 committed by Gitea
commit c67624e80b
8 changed files with 136 additions and 0 deletions

View file

@ -0,0 +1,7 @@
*postfix_exporter-0.1.2 (19 Nov 2019)
19 Nov 2019; <manuel@gentoo.org> +files/postfix_exporter.confd,
+files/postfix_exporter.initd, +files/postfix_exporter.logrotated,
+files/postfix_exporter.service, +metadata.xml,
+postfix_exporter-0.1.2.ebuild:
app-metrics/postfix_exporter: Add ebuild with systemd unit file.

View file

@ -0,0 +1,17 @@
AUX postfix_exporter.confd 527 BLAKE2B c05b24a709dd2d4f67f048975fedae0ca78eaacf42918c56c20d7a1aba8568158ee573076bce0c77518b55db5a78fd36bb0d5bd79138e7a31e47d1b7cc47c7c7 SHA512 6275fc294668e64996053923be9c3c00246c2db5deaaa50b28ddc1f049f953f51d9923813c32ca8f809d409a8e843c0de49fafe3d1ed11f69f222e3e1bf25a77
AUX postfix_exporter.initd 565 BLAKE2B 2bb9b4de2fdefd5e4be00415430eccd378dcb74254a308667679595269936a6acc02249a7c84f3d18f453efca7d64fd0a89748d601e97c8839130f0983285023 SHA512 4a525dfd6cac0d83ebf41b9f9265d1f06816bf25ed5753719451a187d71b7d4bdbc8669c6f34797e6c75ead5c489f18971435aae47396ec8c0c91554c5edbe3b
AUX postfix_exporter.logrotated 105 BLAKE2B 5285292139b4412afa9ab5d0fbe19f17f8785e0f98784a18f400373ec2c079cd4302ebb458564f2f052fc77a9b94709c81445947dd46a108029e680a0fd2b81c SHA512 1c20e1718bdd91df38758d30af520db983146332659d06205112a662eb8f096c3671f7631bc835255fdcb0538c66224c244a523e94f12e08ccb7b85b953844b5
AUX postfix_exporter.service 202 BLAKE2B 2d0bc0ed5f59d35f6b2a749ad6e3407c3763f3a1c61cce8b219c586a98dec7b58675f092030c30a83c628ba55431c9c338fe1a56f93023b2148b3d9bfd275d16 SHA512 769f31691de2ead1a1c099a7b55b3566ea3cfdcec7945d881fd399a77e67e50bcec2ac780abe6fe93ecd022b5b226f6005c3f63a76b0e5acb9ac1498658a751e
DIST github.com-beorn7-perks-3a771d992973f24aa725d07868b467d1ddfceafb.tar.gz 10800 BLAKE2B 5487155a4d010af70b6ea2625d10ae03b6642507902d7dc168edb5d7cf0efa1777b248d0df34ed1a2564950b12613256c1c6ce1d8c9723cc34977ed883b21c8d SHA512 c6aa5df262ab607c0a5f64372fc2fec1ddda9e5624e9d9a22cdd1bc11822c99736d88bdf5e3fc6050217b5084548417cb2926c3940e156da9397d828d59ce277
DIST github.com-coreos-go-systemd-bebb2b01b0473b183e4624aaf8e23ae6f4b22417.tar.gz 60308 BLAKE2B 0b042dae9418cae85d258f1ba029f5edf0550971583c9389a13230b08b6a164600bc9bc36392daaf85af6cd1e1140b6c3f7a8af268be1808e0fe07b5a7223efb SHA512 3469e4db9ad335443ff8da4421e790a21cf56489f8be473fdbe36dc000f6a4497ee68d0038202ab28f5cb7655212e33988ba79ad7cac39fd49f6e35f0f6b728e
DIST github.com-coreos-pkg-97fdf19511ea361ae1c100dd393cc47f8dcfa1e1.tar.gz 32444 BLAKE2B 2601d814407a50eb19e1413228091ecac21ad76bee643e5dfd5e6cff574ddf2dad8a09a1d366f680d48a7402d2ee73eab64dda3a50c3f1be1d594d09c21fb9ed SHA512 3212abf2ec16038d9bd9705bbdaa0f905678b7ec928065f122b54926b90d629ef456c903dd020e98ee56271c82614ca54c4690bb7b258084a0d0bf8422a39d6f
DIST github.com-golang-protobuf-e09c5db296004fbe3f74490e84dcd62c3c5ddb1b.tar.gz 269725 BLAKE2B a62a3f96c49d77776103a9bece69b615e00d4140c9de8b42fb7edac979c8a8d172bd21062d3d6e24ae01dba10b320ff208ff8c6916da2d84118da448afc8caf7 SHA512 f64fa42e7ed9701860e16b1cdedc9f6b029630b6f534ee403ede1223c0c7542c731735995ea9763f093b56146776902b6633e5b1691b1f1dd4ab84dea0092099
DIST github.com-matttproud-golang_protobuf_extensions-c12348ce28de40eed0136aa2b644d0ee0650e56c.tar.gz 37215 BLAKE2B b3b007f925a4a1c1862c8cbe34c5cd225dfa610ad8c56b5328e6920a44b507680daeea97209370bd6b259654d0ca5791f4bcc54b8bd8970b9aaf994eada16d4f SHA512 2f78290d1448cfc041d10210092d6da6f3df2b9b6c16ff730750e976e450dafe2645ba945319a0a3064c88f9c18652c69c0e0cf69d8931c08d23ffe65a8cc07d
DIST github.com-prometheus-client_golang-f504d69affe11ec1ccb2e5948127f86878c9fd57.tar.gz 106949 BLAKE2B b5ee911f6d478ae21a71c2827f541ecd174dee7dbf23fff58a517e739f0e16bf91451a6aabf3f3f786b62256e2c4ee8481cc3169d01819425d56a0eb802a36c9 SHA512 234ad2fa57751901ab2a0e5843bce17689166d8fc285d63f9de0da412cfe7176e8a9f96c0bf5342184985fbb564def31087255bf11766331636c3624fe85eb62
DIST github.com-prometheus-client_model-99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c.tar.gz 54718 BLAKE2B 1dec6ac40fc5103117c2cf0538e138fc57c7b9795516c530b3c0dc2f5983f88c2d0eb1b094859815397fb14d50648240556fb6b11a8935586eca29eb66b4e958 SHA512 99bc72ca0887df4c7ab5a006af9c59afdc1281fe6d6d17f2897428a06da80d63d6ccd476deacb933cb208357500f14a7b96e99b9c5a7582e65a7aae87aaf2c50
DIST github.com-prometheus-common-38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a.tar.gz 63007 BLAKE2B a62f727ef9dd42d52f495ab7449cbafbe7c7fcdb1bc171df97c40348dcb7fe12788223d7a2aea3398cae7dd17ec73ae6349b5e5f35f4785f2796cc9a16c2d420 SHA512 4f1ab6cffc309a00ed68959b9372e1d3ea4f8d597b8c462a4e365cf22737245e601b8bda0764bbd1f0172d773805d16e90a8aa90cb95e9462e35320043e04060
DIST github.com-prometheus-procfs-780932d4fbbe0e69b84c34c20f5c8d0981e109ea.tar.gz 56873 BLAKE2B 31ae12d51b6a28c285bd5854b137d2634499d0db3c2c65c0404ca5a902ffec2e9bf689261ea51c2fe1643733f09a780c437f7a7899a5e6c3e3d100a36e07b897 SHA512 a548c6bc71456c9878cb34ad1514d92c8737e01b555e953f848cc1ae7944424b06a14a8ab0c6de4d99dbb189a0f29e2bb9ae09b5adffc327c28f5c50c2819892
DIST postfix_exporter-0.1.2.tar.gz 11552 BLAKE2B 987c81482fc984e8f6c870fdaf7ce2ef67b3fa66e5782713a645d35b76a1bde1dde97a79705569d1423a9356309d0b7240c77dba386127e8a5035990220d2a62 SHA512 579793281dedd858538ab9a931e0003cfc9989204ebf4352dd4860e5a7f62b919d77a9e0facb9daff6706771010f9e807061dace8cb88928635d55111c7c482a
EBUILD postfix_exporter-0.1.2.ebuild 1851 BLAKE2B 101c64cdf667044ff1cd43cdf5500386c4e3d26de962c6e25fd638422f1d1d86ad012ba51ea8421e884ab97efc59a4e8e0a6c5b2d5df5dcc6b22cb50a579bfdc SHA512 eafd06530a5bd5344801d7ed94622ce373372a2b31ab456f50164ae19387c4bf49e8944cbbcb9a792458f28ce7d05f9a959a60d2c5176f16b7997ab215beb695
MISC ChangeLog 326 BLAKE2B 22f45fbf29654efd2aa16319d67a4e922568bdc9813133cf1b00ddbc21987c7881587bc088e6b2102bac22126e4f12a18b96df5500ef91f04850936dd02ec050 SHA512 4509cce7de1d962e8a305b9ba0678cfbeb9f1e34fdea1e64e4b6b4bd1153cbc5630aede48017b148b5ffac61b300f0ebd2729ca5b8c9b9041b55f01a214ed69b
MISC metadata.xml 255 BLAKE2B 1132f0657024f17717e5191a4992978685715f9abb96052db6399468506deaa85454efcaf58c7dcebfe5e1cf8948c767a7b001832d50c7d9dc162b0ff1395361 SHA512 36fb59a02d322553d6bfad2deeff884cc782c54bbb01a3fb344767fb43536905c43950df368e645d08ba9c48f3ec13c05b1d3c827fa12581c164623d2c174d73

View file

@ -0,0 +1,9 @@
# -postfix.logfile_path string
# Path where Postfix writes log entries. This file will be truncated by this exporter. (default "/var/log/postfix_exporter_input.log")
# -postfix.showq_path string
# Path at which Postfix places its showq socket. (default "/var/spool/postfix/public/showq")
# -web.listen-address string
# Address to listen on for web interface and telemetry. (default ":9154")
# -web.telemetry-path string
# Path under which to expose metrics. (default "/metrics")
command_args=""

View file

@ -0,0 +1,19 @@
#!/sbin/openrc-run
# Copyright 2016-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
description="Prometheus Exporter for Postfix Metrics"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-${RC_SVCNAME}}
group=${group:-${RC_SVCNAME}}
command="/usr/bin/postfix_exporter"
command_args="${command_args:-}"
command_background="true"
start_stop_daemon_args="--user ${user} --group ${group} \
--stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
--stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
depend() {
after net
}

View file

@ -0,0 +1,7 @@
/var/log/postfix_exporter/postfix_exporter.log {
missingok
size 5M
rotate 3
compress
copytruncate
}

View file

@ -0,0 +1,10 @@
[Unit]
Description=Postfix Exporter
[Service]
User=postfix_exporter
EnvironmentFile=/etc/conf.d/postfix_exporter
ExecStart=/usr/bin/postfix_exporter $command_args
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<upstream>
<remote-id type="github">kumina/postfix_exporter</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,59 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EGO_VENDOR=( "github.com/coreos/go-systemd bebb2b01b0473b183e4624aaf8e23ae6f4b22417"
"github.com/coreos/pkg 97fdf19511ea361ae1c100dd393cc47f8dcfa1e1"
"github.com/prometheus/client_golang f504d69affe11ec1ccb2e5948127f86878c9fd57"
"github.com/beorn7/perks 3a771d992973f24aa725d07868b467d1ddfceafb"
"github.com/golang/protobuf e09c5db296004fbe3f74490e84dcd62c3c5ddb1b"
"github.com/prometheus/client_model 99fa1f4be8e564e8a6b613da7fa6f46c9edafc6c"
"github.com/prometheus/common 38c53a9f4bfcd932d1b00bfc65e256a7fba6b37a"
"github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c"
"github.com/prometheus/procfs 780932d4fbbe0e69b84c34c20f5c8d0981e109ea" )
inherit user golang-build golang-vcs-snapshot systemd
EGO_PN="github.com/kumina/postfix_exporter"
ARCHIVE_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
DESCRIPTION="Prometheus Exporter for Postfix"
HOMEPAGE="https://github.com/kumina/postfix_exporter"
SRC_URI="${ARCHIVE_URI}
${EGO_VENDOR_URI}"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="systemd"
DEPEND="systemd? ( sys-apps/systemd )"
RESTRICT="test"
pkg_setup() {
enewgroup ${PN}
enewuser ${PN} -1 -1 -1 ${PN}
}
src_compile() {
pushd src/${EGO_PN} || die
GOPATH="${S}" \
go build -tags "$(usex systemd '' 'nosystemd')" -v -o bin/${PN} || die
popd || die
}
src_install() {
dobin src/${EGO_PN}/bin/${PN}
dodoc src/${EGO_PN}/{CHANGELOG,README}.md
local dir
for dir in /var/{lib,log}/${PN}; do
keepdir "${dir}"
fowners ${PN}:${PN} "${dir}"
done
newinitd "${FILESDIR}"/${PN}.initd ${PN}
newconfd "${FILESDIR}"/${PN}.confd ${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
systemd_dounit "${FILESDIR}"/"${PN}".service
}