first commit
This commit is contained in:
19
files/patch-postfix__exporter.go
Normal file
19
files/patch-postfix__exporter.go
Normal file
@ -0,0 +1,19 @@
|
||||
--- postfix_exporter.go.orig 2019-02-15 11:41:28 UTC
|
||||
+++ postfix_exporter.go
|
||||
@@ -31,6 +31,7 @@ import (
|
||||
|
||||
"github.com/hpcloud/tail"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
+ "github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -691,7 +692,7 @@ func main() {
|
||||
}
|
||||
prometheus.MustRegister(exporter)
|
||||
|
||||
- http.Handle(*metricsPath, prometheus.Handler())
|
||||
+ http.Handle(*metricsPath, promhttp.Handler())
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
_, err = w.Write([]byte(`
|
||||
<html>
|
45
files/postfix_exporter.in
Normal file
45
files/postfix_exporter.in
Normal file
@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $FreeBSD: head/net/postfix_exporter/files/postfix_exporter.in 529909 2020-03-30 19:18:03Z decke $
|
||||
#
|
||||
# PROVIDE: postfix_exporter
|
||||
# REQUIRE: DAEMON
|
||||
# KEYWORD: shutdown
|
||||
#
|
||||
# postfix_exporter_enable (bool): Set to "YES" to enable postfix_exporter.
|
||||
# (default: "NO")
|
||||
#
|
||||
# postfix_exporter_postfix_logfile (str): File where Postfix writes log entries.
|
||||
# Will be truncated by the exporter.
|
||||
# (default: "/var/log/maillog")
|
||||
# postfix_exporter_showq (str): Showq socket path
|
||||
# (default: "/var/spool/postfix/public/showq")
|
||||
# postfix_exporter_listen (str): Exporter listening address
|
||||
# (default: ":9154")
|
||||
# postfix_exporter_telemetry_path (str): Path under which to expose metrics
|
||||
# (default: "/metrics")
|
||||
# postfix_exporter_logfile (str): Postfix_exporter logfile
|
||||
# (default: "/var/log/postfix_exporter.log")
|
||||
#
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name=postfix_exporter
|
||||
rcvar=postfix_exporter_enable
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
: ${postfix_exporter_enable="NO"}
|
||||
: ${postfix_exporter_postfix_logfile="/var/log/maillog"}
|
||||
: ${postfix_exporter_showq="/var/spool/postfix/public/showq"}
|
||||
: ${postfix_exporter_listen=":9154"}
|
||||
: ${postfix_exporter_telemetry_path="/metrics"}
|
||||
: ${postfix_exporter_pidfile:="/var/run/postfix_exporter.pid"}
|
||||
: ${postfix_exporter_user:="postfix_exporter"}
|
||||
: ${postfix_exporter_logfile="/var/log/postfix_exporter.log"}
|
||||
|
||||
command="/usr/local/bin/postfix_exporter"
|
||||
command_args="--web.listen-address=\${postfix_exporter_listen} --web.telemetry-path=\${postfix_exporter_telemetry_path} --postfix.showq_path=\${postfix_exporter_showq} --postfix.logfile_path=\${postfix_exporter_postfix_logfile} > ${postfix_exporter_logfile} 2>&1"
|
||||
start_cmd="/usr/sbin/daemon -u ${postfix_exporter_user} ${command} ${command_args}"
|
||||
|
||||
run_rc_command "$1"
|
Reference in New Issue
Block a user