--- net-mgmt/postfix_exporter/Makefile (nonexistent) +++ net-mgmt/postfix_exporter/Makefile (working copy) @@ -0,0 +1,41 @@ +# $FreeBSD$ + +PORTNAME= postfix_exporter +DISTVERSION= 0.1.2 +CATEGORIES= net-mgmt +DIST_SUBDIR= ${PORTNAME} + +MAINTAINER= fabian.freyer@physik.tu-berlin.de +COMMENT= Postfix Exporter for Prometheus + +LICENSE= APACHE20 + +USES= go +USE_GITHUB= yes +GH_ACCOUNT= kumina +GH_TUPLE+= prometheus:client_golang:v0.8.0:prometheus_client/../src/github.com/prometheus/client_golang +GH_TUPLE+= golang:protobuf:v1.1.0:protobuf/../src/github.com/golang/protobuf +GH_TUPLE+= beorn7:perks:master:quantile/../src/github.com/beorn7/perks +GH_TUPLE+= prometheus:client_model:master:prometheus_client_model/../src/github.com/prometheus/client_model +GH_TUPLE+= prometheus:common:master:prometheus_common/../src/github.com/prometheus/common +GH_TUPLE+= prometheus:procfs:master:prometheus_procfs/../src/github.com/prometheus/procfs +GH_TUPLE+= matttproud:golang_protobuf_extensions:v1.0.1:pbutil/../src/github.com/matttproud/golang_protobuf_extensions + +USE_RC_SUBR= postfix_exporter +USERS= prometheus +GROUPS= prometheus +GO_PKGNAME= github.com/kumina/${PORTNAME} +GO_TARGET= github.com/kumina/${PORTNAME} + +PLIST_FILES= bin/postfix_exporter + +post-extract: + ${MKDIR} ${GO_WRKSRC:H} + ${LN} -sf ${WRKSRC} ${GO_WRKSRC} + ${MKDIR} ${GO_WRKDIR_SRC}/code.google.com/p/ + ${LN} -sf ${GO_WRKDIR_SRC}/github.com/golang/protobuf ${GO_WRKDIR_SRC}/code.google.com/p/goprotobuf + +do-build: + (cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install -tags nosystemd -v ${GO_TARGET}) + +.include --- net-mgmt/postfix_exporter/distinfo (nonexistent) +++ net-mgmt/postfix_exporter/distinfo (working copy) @@ -0,0 +1,17 @@ +TIMESTAMP = 1531493816 +SHA256 (postfix_exporter/kumina-postfix_exporter-0.1.2_GH0.tar.gz) = 88562bd16631f3b09e3cbe791c814c3c2302b0f97deeb717c7c7ab09be01826e +SIZE (postfix_exporter/kumina-postfix_exporter-0.1.2_GH0.tar.gz) = 11552 +SHA256 (postfix_exporter/prometheus-client_golang-v0.8.0_GH0.tar.gz) = 88b0040393276116f848de5bdd636717d339667273cfc45a4edda40b5e5682bd +SIZE (postfix_exporter/prometheus-client_golang-v0.8.0_GH0.tar.gz) = 75593 +SHA256 (postfix_exporter/golang-protobuf-v1.1.0_GH0.tar.gz) = c086490e7b116b73b7e3e6058eae997576d0523ad8f1b2ec2b698887e62b14a8 +SIZE (postfix_exporter/golang-protobuf-v1.1.0_GH0.tar.gz) = 324733 +SHA256 (postfix_exporter/beorn7-perks-master_GH0.tar.gz) = 7e336017925bfd6ac46c8ef93e2da61f800dfa03769276d66f9da93055eaa271 +SIZE (postfix_exporter/beorn7-perks-master_GH0.tar.gz) = 10804 +SHA256 (postfix_exporter/prometheus-client_model-master_GH0.tar.gz) = 9121e5fa5d698d1788f8a16089a229604480effbb10b32b2bd1d6ed872b83da1 +SIZE (postfix_exporter/prometheus-client_model-master_GH0.tar.gz) = 57123 +SHA256 (postfix_exporter/prometheus-common-master_GH0.tar.gz) = 454e54610e665360a3e43dca72c08d95f3a2b7fd021e2e04755ad56fd5edc866 +SIZE (postfix_exporter/prometheus-common-master_GH0.tar.gz) = 77646 +SHA256 (postfix_exporter/prometheus-procfs-master_GH0.tar.gz) = 35ebdc55643a4d06a17f99c6a31858a54134c8f12192b275c5f3e70e03bc3f46 +SIZE (postfix_exporter/prometheus-procfs-master_GH0.tar.gz) = 57787 +SHA256 (postfix_exporter/matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b +SIZE (postfix_exporter/matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 37184 --- net-mgmt/postfix_exporter/files/pkg-message.in (nonexistent) +++ net-mgmt/postfix_exporter/files/pkg-message.in (working copy) @@ -0,0 +1,22 @@ +The postfix_exporter can monitor a postfix log file. This should NOT +be the system-wide maillog, as the exporter will repeatedly truncate +the file. To configure syslogd to additionally log maillog messages +to the default postfix_exporter input logfile, add the following +line to /etc/syslog.conf: + + mail.info /var/log/postfix_exporter_input.log + +The postfix_exporter will need to have permissions to read and write +this file: + + touch /var/log/postfix_exporter_input.log + chown prometheus:prometheus /var/log/postfix_exporter_input.log + +The postfix_exporer can monitor the postfix showq socket. To allow the +postfix_exporter to access this socket, add the prometheus user to the +maildrop group: + + pw usermod prometheus -G maildrop + +To run postfix_exporter, set the postfix_exporter_enable="YES" +rcvar and point your prometheus instance at port 9154. --- net-mgmt/postfix_exporter/files/postfix_exporter.in (nonexistent) +++ net-mgmt/postfix_exporter/files/postfix_exporter.in (working copy) @@ -0,0 +1,69 @@ +#!/bin/sh + +# $FreeBSD$ + +# PROVIDE: postfix_exporter +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# postfix_exporter_enable (bool): Set to NO by default. +# Set it to YES to enable postfix_exporter. +# postfix_exporter_user (string): Set user that postfix_exporter will +# run under +# Default is "prometheus". +# postfix_exporter_group (string): Set group that postfix_exporter will +# run under +# Default is "prometheus". +# postfix_exporter_listen_address (string):Set ip:port that postfix_exporter +# will listen on +# Default is ":9154". +# postfix_exporter_showq_path (string): Path at which Postfix places its +# showq socket +# Default is "/var/spool/postfix/public/showq" +# postfix_exporter_logfile_path (string): Path at which Postfix writes log +# entries. This file will be truncated +# by this exporter. +# Default is "/var/log/postfix_exporter_input.log". +# postfix_exporter_args (string) Additional command line parameters to +# be passed to postfix_exporter +# Default is "" + +. /etc/rc.subr + +name=postfix_exporter +desc="Postfix exporter for use with prometheus" +rcvar=postfix_exporter_enable + +load_rc_config $name + +: ${postfix_exporter_enable:=NO} +: ${postfix_exporter_user:=prometheus} +: ${postfix_exporter_group:=prometheus} +: ${postfix_exporter_listen_address=:9154} +: ${postfix_exporter_showq_path=/var/spool/postfix/public/showq} +: ${postfix_exporter_logfile_path=/var/log/postfix_exporter_input.log} + +pidfile=/var/run/postfix_exporter.pid +command=/usr/sbin/daemon +procname="%%PREFIX%%/bin/postfix_exporter" +command_args="-p ${pidfile} -T ${name}/usr/bin/env ${procname} \ + --web.listen-address=${postfix_exporter_listen_address} \ + --postfix.showq_path="${postfix_exporter_showq_path}" \ + --postfix.logfile_path="${postfix_exporter_logfile_path}" \ + ${postfix_exporter_args}" + +start_precmd=postfix_exporter_startprecmd + +postfix_exporter_startprecmd() +{ + if [ ! -e ${pidfile} ]; then + install -o ${postfix_exporter_user} -g ${postfix_exporter_group} /dev/null ${pidfile}; + else + chown ${postfix_exporter_user}:${postfix_exporter_group} ${pidfile}; + fi +} + +run_rc_command "$1" --- net-mgmt/postfix_exporter/pkg-descr (nonexistent) +++ net-mgmt/postfix_exporter/pkg-descr (working copy) @@ -0,0 +1,5 @@ +postfix_exporter is a prometheus exporter for the postfix mail server. +This exporter provieds histogram metrics for the size and age of messages +stored in the mail queue as well as event counts. + +WWW: https://github.com/kumina/postfix_exporter