prometheus: treat exim log file as binary (#50699)

This commit is contained in:
Frédéric Péters 2021-01-30 14:33:17 +01:00
parent cb3a3c28ab
commit 56c6a8b13b
1 changed files with 2 additions and 2 deletions

View File

@ -64,9 +64,9 @@ def etckeeper(ctn):
def exim(ctn):
with open('/var/log/exim4/mainlog') as fh:
with open('/var/log/exim4/mainlog', 'rb') as fh:
for line in fh.readlines():
if " ** " in line:
if b" ** " in line:
eo_exim.labels(ctn, "errors").inc()
deferred = int(run("exim -bpc"))
eo_exim.labels(ctn, "deferred").set(deferred)