View | Details | Raw Unified | Return to bug 229756 | Differences between
and this patch

Collapse All | Expand All

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

Return to bug 229756