diff options
6 files changed, 114 insertions, 0 deletions
diff --git a/app-metrics/postfix_exporter/Manifest b/app-metrics/postfix_exporter/Manifest new file mode 100644 index 000000000000..0d848ba69037 --- /dev/null +++ b/app-metrics/postfix_exporter/Manifest @@ -0,0 +1,10 @@ +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 diff --git a/app-metrics/postfix_exporter/files/postfix_exporter.confd b/app-metrics/postfix_exporter/files/postfix_exporter.confd new file mode 100644 index 000000000000..a96327925e11 --- /dev/null +++ b/app-metrics/postfix_exporter/files/postfix_exporter.confd @@ -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="" diff --git a/app-metrics/postfix_exporter/files/postfix_exporter.initd b/app-metrics/postfix_exporter/files/postfix_exporter.initd new file mode 100644 index 000000000000..8fce39c9db03 --- /dev/null +++ b/app-metrics/postfix_exporter/files/postfix_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 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 +} diff --git a/app-metrics/postfix_exporter/files/postfix_exporter.logrotated b/app-metrics/postfix_exporter/files/postfix_exporter.logrotated new file mode 100644 index 000000000000..7c9e9f4018c8 --- /dev/null +++ b/app-metrics/postfix_exporter/files/postfix_exporter.logrotated @@ -0,0 +1,7 @@ +/var/log/postfix_exporter/postfix_exporter.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-metrics/postfix_exporter/metadata.xml b/app-metrics/postfix_exporter/metadata.xml new file mode 100644 index 000000000000..7f7638315a35 --- /dev/null +++ b/app-metrics/postfix_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">kumina/postfix_exporter</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-metrics/postfix_exporter/postfix_exporter-0.1.2.ebuild b/app-metrics/postfix_exporter/postfix_exporter-0.1.2.ebuild new file mode 100644 index 000000000000..4eeeb08ad702 --- /dev/null +++ b/app-metrics/postfix_exporter/postfix_exporter-0.1.2.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2018 Gentoo Foundation +# 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 + +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}" +} |