Page 2 of 3
Re: Questions from a beginner
Posted: Tue May 07, 2013 9:42 am
by WillemDH
Did you get my pm? The message seems to stay in out box instead of sent items..
In fact I already tried your proposal before, but it wasn't working, so I tried changing it to the xi notification handlers. But i did the test again, set everything exactly as you asked and redid the test. The notifications are visible for test.contact and willem.dh in the notifications view, but no email has been sent out to the willem.dh email address..
Re: Questions from a beginner
Posted: Tue May 07, 2013 12:43 pm
by slansing
Hmm, odd, maybe my reply did not get to you either I am going to try re-sending it as it has email addresses in it that we should not share on the open forum.
Re: Questions from a beginner
Posted: Mon May 13, 2013 2:33 am
by WillemDH
So the problem is that contacts seem to use an other smtp address as users. At the moment we can see in the maillog that email for contacts is sent to mail.domain.be Does anyone know how to change this for contacts? Email sent to users use the correct smtp server configures in Admin > Manage Email Settings
Re: Questions from a beginner
Posted: Mon May 13, 2013 10:50 am
by slansing
I replied to your PM William, can you also send me an example of a contact who is having emails routed to them from XI through the incorrect SMTP domain? Also an updated snapshot if you have made changes to them, thanks!
Re: Questions from a beginner
Posted: Wed May 15, 2013 10:28 am
by WillemDH
Email sent to a user is sent throught the correct smtp address. Email sent to contacts is sent to another smtp address... The smtp address in smanage email settings is correct... In the maillog i can see nagios trying to send email to a contact with the wrong smtp server.
Re: Questions from a beginner
Posted: Wed May 15, 2013 3:01 pm
by abrist
How many contacts do you have that are not XI users? If the number is small, you could always make them a user with a random, large character number password. This would allow you to use the xi notification handlers instead of the core ones.
Re: Questions from a beginner
Posted: Thu May 16, 2013 4:01 am
by WillemDH
That is what I'm doing now. I need to create a user for every email contact. It isn't a "clean" solution though. Would be nice if someone could tell me why the smtp server settings from "Manage email settings are not used by the core notification handler.
Re: Questions from a beginner
Posted: Thu May 16, 2013 11:57 am
by abrist
Could you post a copy of your notify-*-by-email commands?
Re: Questions from a beginner
Posted: Wed May 22, 2013 4:53 am
by WillemDH
Do you mean this?
notify-host-by-email
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
notify-service-by-email
/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Re: Questions from a beginner
Posted: Wed May 22, 2013 3:45 pm
by sreinhardt
The reason the standard notify-by commands and the XI-notify commands are different, is due to a complete rewrite of how notifications are sent. The standard nagios commands are sent through core and use your local mta, whereas the new commands are sent through php-mailer, use postgres information.