mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-10-06 05:14:36 +08:00
Fix: Fix syslog logging to stdout + fix starting of exporter
This commit is contained in:
parent
5a09ee5a45
commit
bcf7dcbfcb
2 changed files with 31 additions and 15 deletions
|
@ -1,5 +1,6 @@
|
||||||
$ModLoad immark.so # provides --MARK-- message capability
|
$ModLoad immark.so # provides --MARK-- message capability
|
||||||
$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command)
|
$ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command)
|
||||||
|
$ModLoad omstdout.so # provide messages to stdout
|
||||||
|
|
||||||
# default permissions for all log files.
|
# default permissions for all log files.
|
||||||
$FileOwner root
|
$FileOwner root
|
||||||
|
@ -45,17 +46,31 @@ template(name="plain" type="list") {
|
||||||
#module(load="mmexternal")
|
#module(load="mmexternal")
|
||||||
#</email-anonymizer>
|
#</email-anonymizer>
|
||||||
|
|
||||||
|
# Severity levels are numbered 0 to 7:
|
||||||
|
#
|
||||||
|
# 0 – emergency (System unusable)
|
||||||
|
# 1 – alert (Immediate action needed)
|
||||||
|
# 2 – critical events (Critical condition)
|
||||||
|
# 3 – error events (Error condition)
|
||||||
|
# 4 – warning events (Warning condition)
|
||||||
|
# 5 – notification events (Normal but significant condition)
|
||||||
|
# 6 – informal events (Informational message only)
|
||||||
|
# 7 – debug messages (Appears during debugging only)
|
||||||
|
|
||||||
|
include(file="/etc/rsyslog.d-before/*.conf" mode="optional")
|
||||||
|
|
||||||
if $syslogseverity <= '6' then {
|
if $syslogseverity <= '6' then {
|
||||||
# Do not log healthchecks
|
# Do not log healthchecks
|
||||||
if ($msg contains_i "connect from localhost[127.0.0.1]") then { stop }
|
if ($msg contains_i "connect from localhost[127.0.0.1]") then { stop }
|
||||||
if ($msg contains_i "lost connection after EHLO from localhost[127.0.0.1]") then { stop }
|
if ($msg contains_i "lost connection after EHLO from localhost[127.0.0.1]") then { stop }
|
||||||
if ($msg contains_i "disconnect from localhost[127.0.0.1] ehlo=1 commands=1") then { stop }
|
if ($msg contains_i "disconnect from localhost[127.0.0.1] ehlo=1 commands=1") then { stop }
|
||||||
#<email-anonymizer>
|
|
||||||
#action(type="mmexternal" binary="/scripts/email-anonymizer.sh <anon-email-format>" interface.input="msg")
|
|
||||||
#</email-anonymizer>
|
|
||||||
action(type="omfile" DynaFile="devicelog" template="<log-format>" DirCreateMode="0755" FileCreateMode="0644")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#<email-anonymizer>
|
||||||
|
#action(type="mmexternal" binary="/scripts/email-anonymizer.sh <anon-email-format>" interface.input="msg")
|
||||||
|
#</email-anonymizer>
|
||||||
|
action(name="stdout" type="omfile" DynaFile="devicelog" template="<log-format>" DirCreateMode="0755" FileCreateMode="0644")
|
||||||
|
|
||||||
include(file="/etc/rsyslog.d-metrics/*.conf" mode="optional")
|
include(file="/etc/rsyslog.d-metrics/*.conf" mode="optional")
|
||||||
include(file="/etc/rsyslog.d/*.conf" mode="optional")
|
include(file="/etc/rsyslog.d/*.conf" mode="optional")
|
||||||
|
|
||||||
|
|
|
@ -110,10 +110,10 @@ spec:
|
||||||
mountPath: /etc/logrotate.d/logrotate.conf
|
mountPath: /etc/logrotate.d/logrotate.conf
|
||||||
subPath: logrotate.conf
|
subPath: logrotate.conf
|
||||||
- name: metrics-config-scripts
|
- name: metrics-config-scripts
|
||||||
mountPath: /etc/cron.hourly/ # Ubuntu
|
mountPath: /etc/cron.hourly/logrotate.sh # Ubuntu
|
||||||
subPath: logrotate.sh
|
subPath: logrotate.sh
|
||||||
- name: metrics-config-scripts
|
- name: metrics-config-scripts
|
||||||
mountPath: /etc/periodic/hourly # Alpine
|
mountPath: /etc/periodic/hourly/logrotate.sh # Alpine
|
||||||
subPath: logrotate.sh
|
subPath: logrotate.sh
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -142,15 +142,16 @@ spec:
|
||||||
name: metrics
|
name: metrics
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
command:
|
command:
|
||||||
- sh
|
- /bin/postfix_exporter
|
||||||
- -c
|
|
||||||
args:
|
args:
|
||||||
- |-
|
- "--web.listen-address"
|
||||||
/bin/postfix_exporter
|
- {{ print "0.0.0.0:" .Values.metrics.port | quote }}
|
||||||
--web.listen-address {{ .Values.metrics.port }}
|
- "--web.telemetry-path"
|
||||||
--web.telemetry-path {{ .Values.metrics.path | quote }}
|
- {{ .Values.metrics.path | quote }}
|
||||||
--postfix.logfile_path {{ .Values.metrics.maillog | quote }}
|
- "--postfix.logfile_path"
|
||||||
--postfix.showq_path /var/spool/postfix/public/showq
|
- {{ .Values.metrics.maillog | quote }}
|
||||||
|
- "--postfix.showq_path"
|
||||||
|
- {{ print "/var/spool/postfix/public/showq" | quote }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: {{ $fullName | quote }}
|
- name: {{ $fullName | quote }}
|
||||||
mountPath: /var/spool/postfix
|
mountPath: /var/spool/postfix
|
||||||
|
|
Loading…
Add table
Reference in a new issue