I can't receive email notifications after migrating Nagios to Rocky 9

Hello everyone,

I can’t receive email notifications after migrating Nagios to another server,

Old nagios version is : 4.4.5 (rocky 8)
New version is the latst (rokcy 9),

I installed the nagios on new server and the plugins
I transferred all the configuration files and I installed postfix , I transferred main.cf to newServer

scp /usr/local/nagios/etc/*.cfg NewServer:/usr/local/nagios/etc/
scp /usr/local/nagios/etc/objects/*.cfg NewServer:/usr/local/nagios/etc/objects/
scp -r /usr/local/nagios/etc/objects/* NewServer:/usr/local/nagios/etc/objects/
scp /etc/httpd/conf.d/* NewServer:/etc/httpd/conf.d/
scp /usr/local/nagios/etc/htpasswd.users NewServer:/usr/local/nagios/etc/htpasswd.users
scp /usr/local/nagios/etc/cgi.cfg NewServer:/usr/local/nagios/etc/
scp /etc/letsencrypt/* NewServer:/etc/letsencrypt/
scp -r /etc/letsencrypt/* NewServer:/etc/letsencrypt/

Any help plz,
Thank you,

Please check the following:

  • What mail tranfer agent is defined in your config.
  • Is the mta utility present on your new system? if not, install the defined mta.
  • Check if the absolute path to the utility still checks out, for example if it is /bin/mail check the absolute path to the utility on the new system with which mail and correct the config if it is different.

And on the side note, probably not the cause of your issues, check the permissions and ownership on the config files. scp does not preserve the owner and the group of the file. So if you used root to copy the files, root is the owner of all files. You can use scp with the option -p to preserve file mode bits and then set the appropriate owner and group with chown.

Hello ,
I installed postfix as MTA, and I transefed main.cf on the Old Server

For scp , I used also rsync -av to preserve the owner ,
the command /bin/mail is worked on old server but the new no,

I installed sendmail with postfix, It’s work now
Thank you