Hello,
Does anyone have a nagios script to monitor mailcow mailq ?
Thx
English
Hello,
Does anyone have a nagios script to monitor mailcow mailq ?
Thx
Have something to say?
Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!
That doesn’t monitor mailq (number of mails in queue) but container status and disk usage.
Hi, I wrote a little script for that which I use in my local CheckMK monitoring platform:
#!/bin/bash
if find /var/lib/docker/volumes/mailcowdockerized_postfix-vol-1/_data/deferred -type f -mmin +20 | grep . >/dev/null
then
COUNT=$(find /var/lib/docker/volumes/mailcowdockerized_postfix-vol-1/_data/deferred -type f -mmin +20 | wc -l)
for mail in $(find /var/lib/docker/volumes/mailcowdockerized_postfix-vol-1/_data/deferred -type f -mmin +20 )
do
DOMAIN="$DOMAIN $(postcat $mail | grep original_recipient | awk '{print $2}' | awk -F@ '{print $2}')"
done
echo "WARNING: $COUNT mails in q, domain(s): $DOMAIN"
exit 1
else
echo "Mail queue ok"
exit 0
fi
It checks for deferred mails older than 20 minutes. Feel free to adapt it
This not a purely nagios script but thx to share it.
Yes, but you can easily integrate it into a Nagios check
check_mailq or nrpe check… its all possible, maybe not out of the box… but isn’t that exactly the reason why we use opensource