Configuring e-Mail Notifications in Nagios Core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Configuring e-Mail Notifications in Nagios Core

Post by michaelpn »

Hi Kyang,

output: /usr/bin/mail
Should I still install mailx ?
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Configuring e-Mail Notifications in Nagios Core

Post by michaelpn »

[quote="michaelpn"]Hi Kyang,

output: /usr/bin/mail - please see my attachment. My "notify-host-by-email' command definition" is set to => usr/bin/mail in the definition :)





Should I still install mailx ?

Yes I still recieve SMS notification :)
Attachments
katalog.PNG
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
kyang

Re: Configuring e-Mail Notifications in Nagios Core

Post by kyang »

output: /usr/bin/mail - please see my attachment. My "notify-host-by-email' command definition" is set to => usr/bin/mail in the definition
It seems like you are missing a /? Instead of usr/bin/mail it should be /usr/bin/mail

Could you post your commands.cfg again, just to double check?
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Configuring e-Mail Notifications in Nagios Core

Post by michaelpn »

Hi kyang,

now it works :) :) you were right :) it was "/" missing.

Now it is working for my my mail accout. Do I then have to setup my colleges mail accounts the same way I did with my using this?


Configure Postfix For Relaying

To configure our Postfix server for relaying emails through smtp.example.com, we run

postconf -e 'relayhost = smtp.example.com'
postconf -e 'smtp_sasl_auth_enable = yes'
postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'
postconf -e 'smtp_sasl_security_options ='

Our username (someuser) and password (howtoforge) for smtp.example.com must be stored in /etc/postfix/sasl_passwd, therefore we do this:

echo "smtp.example.com someuser:howtoforge" > /etc/postfix/sasl_passwd

/etc/postfix/sasl_passwd must be owned by root, and noone else should have read access to that file, so we do this:

chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd

Now we must convert /etc/postfix/sasl_passwd into a format that Postfix can read:

postmap /etc/postfix/sasl_passwd

This will create the file /etc/postfix/sasl_passwd.db.

All that is left to do is restart Postfix:

/etc/init.d/postfix restart
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
kyang

Re: Configuring e-Mail Notifications in Nagios Core

Post by kyang »

Glad to hear it's working!
Now it is working for my my mail accout. Do I then have to setup my colleges mail accounts the same way I did with my using this?
By this, do you mean you will be setting up other mail accounts for another Core or the same Core server?
by dwhitfield
You're probably just going to be sending email as one user, correct? That would be the only user that needs to auth.
What @dwhitfield said is probably still the case, but try it out and see what happens.

Did you have any more questions or are we okay to close this thread?
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Configuring e-Mail Notifications in Nagios Core

Post by michaelpn »

Hi kyang,

What I’m meaning is I still have 5 other users who should be notisfied like me by mail. So my question is how should I do that ? Do I use the same command like I did for me meaning using the relay configuring ? You see in my contact.cfg file all get a SMS notification the should also be notified by mail. Do you now understand :) I will try to enable them again in my contact.cfg file and look how it goes :)
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Configuring e-Mail Notifications in Nagios Core

Post by michaelpn »

Hi
you can close this thread now.
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
kyang

Re: Configuring e-Mail Notifications in Nagios Core

Post by kyang »

Sounds great, hope you got it working! I'll be closing this topic.

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!
Locked