Nagios Mail Setting - Send Mail From

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
amozahim
Posts: 9
Joined: Wed Oct 17, 2018 12:29 am

Nagios Mail Setting - Send Mail From

Post by amozahim »

Dears
I have installed latest nagios version, and configure it and it is working fine.

The only problem is in mail setting I added Send Mail From: NagiosXi@mydomain.com but I received emails from nagios@NagiosServerName.

Although we have a testing one and working fine with same configuration.
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Mail Setting - Send Mail From

Post by npolovenko »

Hello, @amozahim. Can you check to see which notification commands are being used? In Core Configurations Manager go to the Contacts menu in the left column, select a contact and go to the Alert Settings tab. You can find the commands under Manage Host Notification Commands and Manage Service Notification Commands.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amozahim
Posts: 9
Joined: Wed Oct 17, 2018 12:29 am

Re: Nagios Mail Setting - Send Mail From

Post by amozahim »

Thanks For Reply
I used the default command in notify_host_by_email command definition

/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$
amozahim
Posts: 9
Joined: Wed Oct 17, 2018 12:29 am

Re: Nagios Mail Setting - Send Mail From

Post by amozahim »

npolovenko wrote:Hello, @amozahim. Can you check to see which notification commands are being used? In Core Configurations Manager go to the Contacts menu in the left column, select a contact and go to the Alert Settings tab. You can find the commands under Manage Host Notification Commands and Manage Service Notification Commands.

The default Command 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$
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Mail Setting - Send Mail From

Post by npolovenko »

@amozahim, The notify_host_by_email and notify_service_by_email commands are using the default sendmail script. In order to be able to use SMTP you need to change notification commands to xi_host_notification_handler and xi_service_notification_handler.
PS: Each contact that is using the notification_handler commands needs to have a corresponding username in XI.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amozahim
Posts: 9
Joined: Wed Oct 17, 2018 12:29 am

Re: Nagios Mail Setting - Send Mail From

Post by amozahim »

I still Receive emails using notify_host_by_email which is not SMTP
I use xi_host_notification_handler to use SMTP but still not working to send emails although I create user and use the contact for that user.

although send_test_email is working fine
You do not have the required permissions to view the files attached to this post.
amozahim
Posts: 9
Joined: Wed Oct 17, 2018 12:29 am

Re: Nagios Mail Setting - Send Mail From

Post by amozahim »

We Have about 100 host, and we have 5 admins
every admin has 20 host
we need to send notification email about the host status, each admin will receive notification for his own hosts only.

We configure it with send mail (notify_host_by_email) and work fine, but we need to use SMTP, how to use xi_host_notification_handler ?

we do not know how to do it
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Mail Setting - Send Mail From

Post by npolovenko »

Hello, @amozahim . I see on the screenshot that you added the xi_host_notification_handler command as the second notification command. You should delete the old commands -> notify-host-by-email and notify-service-by-email from the assigned notification commands and leave only the new ones.
every admin has 20 host
we need to send notification email about the host status, each admin will receive notification for his own hosts only.
This is possible to set up. You need to open each host in Core Configurations Manager and make sure that it's only assigned to the corresponding XI contact.
Each contact needs to have a corresponding username.
You also need to sign in to the XI as each user, click on the username next to the logout button(in top right corner), click on Notification Preferences in the left column and make sure that Enable Notifications is checked. Then go to the Notification Methods menu in the left column and check "Recieve alerts via email".

https://assets.nagios.com/downloads/nag ... ios-XI.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
amozahim
Posts: 9
Joined: Wed Oct 17, 2018 12:29 am

Re: Nagios Mail Setting - Send Mail From

Post by amozahim »

Thank You Very much :)
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios Mail Setting - Send Mail From

Post by npolovenko »

@amozahim, You're welcome! Are we ready to lock this thread as resolved?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked