Skip to content
Snippets Groups Projects
Commit 51dcdcda authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Adds a basic mail monitoring.

parent f10a5ead
No related branches found
No related tags found
No related merge requests found
[Service]
Type=oneshot
ExecStart=/libre.sh/utils/mail-mon.sh
[Unit]
Description=Run mail mon hourly and on boot
[Timer]
OnBootSec=15min
OnUnitActiveSec=1h
[Install]
WantedBy=timers.target
#!/bin/bash -eux
/usr/bin/journalctl --since '1 hour ago' | grep postfix/cleanup | grep "from=" | sed -n 's/.*from=<\(.*\)> to=<\(.*\)> pro.*/\1/p' | sort |uniq -c | sort | awk 'BEGIN {FS=" ";} {printf "mail_sent{domain_name=\"%s\"} %s\n", $2, $1}' > /system/metrics-collection/textfiles/mail.prom
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment