Issue with email notifications

Hello,

I have a problem with configuring email notifications. My postfix is all configured and working. When I run the command:

echo “This is the message body” | mail -s “This is the subject” my_name@mail.com -aFrom:StorageMailer@company.com

I get the email. But when I switch to OMD and run the same I get an error:

OMD[cmk]:~$ postdrop: warning: unable to look up public/pickup: No such file or directory

I have to have Sender specified or my mailrelay will not let the mail through. My check_mk is deployed on Docker. I ran the suggested command “mkfifo /var/spool/postfix/public/pickup” but I still don’t get emails from cmk. I noticed that after I do “sudo docker exec -ti monitoring /bin/bash” to get to OMD the /etc/postfix/main.cf is different from the postfix config when I’m directly on my server (I’m not sure how to explain that). Should I copy it over?

Am I to understand that if dockered, the check_mk instance will use the postfix that’s in the docker itself?

1 Like

If your postfix is reachable from inside the docker container it would be the easiest way to use the direct delivery with the option from inside CMK notification rules.

The public/pickup is existing inside the container if you start the postfix service inside the container.
But you have to configure this service also to forward to another smart host.
Before i need to configure an extra service i can also directly forward my mail to the needed smart host :slight_smile:

I followed up this guide: Sending email from docker through Postfix installed on the host - Satish Gandham but there’s still something missing.

I will check your suggestion on Monday when I’m back at work. The IP on the screen would be the host where docker is deployed?

Looks like I took an arrow to the knee with choosing to use docker rather than direct installation :smiley:

The linked article is only helpful if you want to access the system postfix with SMTP.
But you want to use the mail command inside your docker container. For this you need an active postfix inside the container.

This can be any from inside the container reachable mail server.

I don’t have the option “Enable synchronous delivery via SMTP” from your screen in my Notification Method section. Is this something from Enterprise version? I’m using raw.

Ok this is possible that it is only there if you have the mknotifyd running.
And this is part of the enterprise edition.
For your configuration you have the only option to use the included postfix from the container.

I will only give you the tip don’t use this container installation for monitoring bigger systems. It is good for dev and testing but the docker system cannot handle the high and dynamic demand of cpu und io very well if you have more than some systems in your monitoring.

Thank you. Looks like the easiest way will be to install the new instance directly. One question though - if I install new on the same server that hosts the docker will the installation process set new instance under new port automatically or will I have to reconfigure it manually afterwards?

Make a backup of your instance that is running inside the docker container with “omd backup” and restore this then with “omd restore” on your target machine (the docker host itself).

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.