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

Collapse All | Expand All

(-)net-mgmt/postfix_exporter/Makefile (+40 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	postfix_exporter
4
DISTVERSION=	0.1.2
5
CATEGORIES=	net-mgmt
6
7
MAINTAINER=	fabian.freyer@physik.tu-berlin.de
8
COMMENT=	Postfix Exporter for Prometheus
9
10
LICENSE=	APACHE20
11
12
USES=		go
13
USE_GITHUB=	yes
14
GH_ACCOUNT=	kumina
15
GH_TUPLE+=	prometheus:client_golang:v0.8.0:prometheus_client/../src/github.com/prometheus/client_golang
16
GH_TUPLE+=	golang:protobuf:v1.1.0:protobuf/../src/github.com/golang/protobuf
17
GH_TUPLE+=	beorn7:perks:3a771d992973f24aa725d07868b467d1ddfceafb:quantile/../src/github.com/beorn7/perks
18
GH_TUPLE+=	prometheus:client_model:5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f:prometheus_client_model/../src/github.com/prometheus/client_model
19
GH_TUPLE+=	prometheus:common:7600349dcfe1abd18d72d3a1770870d9800a7801:prometheus_common/../src/github.com/prometheus/common
20
GH_TUPLE+=	prometheus:procfs:ae68e2d4c00fed4943b5f6698d504a5fe083da8a:prometheus_procfs/../src/github.com/prometheus/procfs
21
GH_TUPLE+=	matttproud:golang_protobuf_extensions:v1.0.1:pbutil/../src/github.com/matttproud/golang_protobuf_extensions
22
23
USE_RC_SUBR=	postfix_exporter
24
USERS=		prometheus
25
GROUPS=		prometheus
26
GO_PKGNAME=	github.com/kumina/${PORTNAME}
27
GO_TARGET=	github.com/kumina/${PORTNAME}
28
29
PLIST_FILES=	bin/postfix_exporter
30
31
post-extract:
32
	${MKDIR} ${GO_WRKSRC:H}
33
	${LN} -sf ${WRKSRC} ${GO_WRKSRC}
34
	${MKDIR} ${GO_WRKDIR_SRC}/code.google.com/p/
35
	${LN} -sf ${GO_WRKDIR_SRC}/github.com/golang/protobuf ${GO_WRKDIR_SRC}/code.google.com/p/goprotobuf
36
37
do-build:
38
	(cd ${GO_WRKSRC}; ${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} install -tags nosystemd -v ${GO_TARGET})
39
40
.include <bsd.port.mk>
(-)net-mgmt/postfix_exporter/distinfo (+17 lines)
Line 0 Link Here
1
TIMESTAMP = 1532370118
2
SHA256 (kumina-postfix_exporter-0.1.2_GH0.tar.gz) = 88562bd16631f3b09e3cbe791c814c3c2302b0f97deeb717c7c7ab09be01826e
3
SIZE (kumina-postfix_exporter-0.1.2_GH0.tar.gz) = 11552
4
SHA256 (prometheus-client_golang-v0.8.0_GH0.tar.gz) = 88b0040393276116f848de5bdd636717d339667273cfc45a4edda40b5e5682bd
5
SIZE (prometheus-client_golang-v0.8.0_GH0.tar.gz) = 75593
6
SHA256 (golang-protobuf-v1.1.0_GH0.tar.gz) = c086490e7b116b73b7e3e6058eae997576d0523ad8f1b2ec2b698887e62b14a8
7
SIZE (golang-protobuf-v1.1.0_GH0.tar.gz) = 324733
8
SHA256 (beorn7-perks-3a771d992973f24aa725d07868b467d1ddfceafb_GH0.tar.gz) = 9edc7a840112708d6a826c99eb46c1b91aec2faeac2c707fc89faa77af8fda06
9
SIZE (beorn7-perks-3a771d992973f24aa725d07868b467d1ddfceafb_GH0.tar.gz) = 10800
10
SHA256 (prometheus-client_model-5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f_GH0.tar.gz) = a386eaae72fba4f3abf561bdacc88125ef5179716ec06917a39eb3102ca68d51
11
SIZE (prometheus-client_model-5c3871d89910bfb32f5fcab2aa4b9ec68e65a99f_GH0.tar.gz) = 57195
12
SHA256 (prometheus-common-7600349dcfe1abd18d72d3a1770870d9800a7801_GH0.tar.gz) = 7f9b19519e2f3f86b0e1b32630187ec48e4dadf2d362fd41dd1bbeec2aaebcbe
13
SIZE (prometheus-common-7600349dcfe1abd18d72d3a1770870d9800a7801_GH0.tar.gz) = 77798
14
SHA256 (prometheus-procfs-ae68e2d4c00fed4943b5f6698d504a5fe083da8a_GH0.tar.gz) = db93c0748fd95d1006aec3620dd03055f655f24daea8c6635a84c3b0699cc25c
15
SIZE (prometheus-procfs-ae68e2d4c00fed4943b5f6698d504a5fe083da8a_GH0.tar.gz) = 57831
16
SHA256 (matttproud-golang_protobuf_extensions-v1.0.1_GH0.tar.gz) = 2def0ee6f6b12b1efc0e3007d89f598608a072610e805c3655ea9d13c3ead49b
17
SIZE (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