diff --git a/configs/rsyslog.conf b/configs/rsyslog.conf
index bab8fda..9bfb15e 100644
--- a/configs/rsyslog.conf
+++ b/configs/rsyslog.conf
@@ -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 omstdout.so # provide messages to stdout
# default permissions for all log files.
$FileOwner root
@@ -45,17 +46,31 @@ template(name="plain" type="list") {
#module(load="mmexternal")
#
+# 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 {
# Do not log healthchecks
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 "disconnect from localhost[127.0.0.1] ehlo=1 commands=1") then { stop }
- #
- #action(type="mmexternal" binary="/scripts/email-anonymizer.sh " interface.input="msg")
- #
- action(type="omfile" DynaFile="devicelog" template="" DirCreateMode="0755" FileCreateMode="0644")
}
+#
+#action(type="mmexternal" binary="/scripts/email-anonymizer.sh " interface.input="msg")
+#
+action(name="stdout" type="omfile" DynaFile="devicelog" template="" DirCreateMode="0755" FileCreateMode="0644")
+
include(file="/etc/rsyslog.d-metrics/*.conf" mode="optional")
include(file="/etc/rsyslog.d/*.conf" mode="optional")
diff --git a/helm/mail/templates/statefulset.yaml b/helm/mail/templates/statefulset.yaml
index dbc9b1b..c16d8ae 100644
--- a/helm/mail/templates/statefulset.yaml
+++ b/helm/mail/templates/statefulset.yaml
@@ -110,10 +110,10 @@ spec:
mountPath: /etc/logrotate.d/logrotate.conf
subPath: logrotate.conf
- name: metrics-config-scripts
- mountPath: /etc/cron.hourly/ # Ubuntu
+ mountPath: /etc/cron.hourly/logrotate.sh # Ubuntu
subPath: logrotate.sh
- name: metrics-config-scripts
- mountPath: /etc/periodic/hourly # Alpine
+ mountPath: /etc/periodic/hourly/logrotate.sh # Alpine
subPath: logrotate.sh
{{- end }}
{{- end }}
@@ -142,15 +142,16 @@ spec:
name: metrics
protocol: TCP
command:
- - sh
- - -c
+ - /bin/postfix_exporter
args:
- - |-
- /bin/postfix_exporter
- --web.listen-address {{ .Values.metrics.port }}
- --web.telemetry-path {{ .Values.metrics.path | quote }}
- --postfix.logfile_path {{ .Values.metrics.maillog | quote }}
- --postfix.showq_path /var/spool/postfix/public/showq
+ - "--web.listen-address"
+ - {{ print "0.0.0.0:" .Values.metrics.port | quote }}
+ - "--web.telemetry-path"
+ - {{ .Values.metrics.path | quote }}
+ - "--postfix.logfile_path"
+ - {{ .Values.metrics.maillog | quote }}
+ - "--postfix.showq_path"
+ - {{ print "/var/spool/postfix/public/showq" | quote }}
volumeMounts:
- name: {{ $fullName | quote }}
mountPath: /var/spool/postfix