Page 1 of 1
Nagios XI alert notification
Posted: Thu Nov 08, 2018 10:11 am
by lukedevon
Hi
How can we create two notification types at once? Via email and SMS? As I know we are able to configure only one SMTP server in Nagios XI.
When an alarm has been generated, it has to be delivered via email and SMS both methods.
also can we send only WARNING alerts via email and CRITICAL alerts via SMS?
Appreciate your guide and support.
Thank you
Luke.
Re: Nagios XI alert notification
Posted: Thu Nov 08, 2018 4:28 pm
by benjaminsmith
Hi
@lukedevon
You can set the notification preferences for email and SMS messages in Admin > Users > Notification Management
notifications.png
You can select notification types for your contact template for various states such as cricital, recovery, warning...etc.
We have a knowledgebase article on how to setup SMS alerts in Nagios XI:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Please keep in mind, these settinsg apply to Nagios XI users (
https://assets.nagios.com/downloads/nag ... ntacts.pdf).
Let me know if you have any other questions.
Re: Nagios XI alert notification
Posted: Thu Nov 08, 2018 8:53 pm
by lukedevon
Hi Benjamin,
Thank you for the reply.
As I checked, we can't define two SMTP servers in XI. Say, for instance, we have one SMTP server for email and the other SMTP server for SMS.
--> SMS sending in SMTP format (mobilenumber@smstpserver)
May I know if this requirement can be done?
Regards
Luke
Re: Nagios XI alert notification
Posted: Thu Nov 08, 2018 10:45 pm
by lukedevon
Hi
Are we able to use one of Linux MTA in Centos, such as sendmail to send emails to another SMTP server, while Nagios uses its own SMTP configurations to configure the main SMTP server?
* main SMTP server will configure in Nagios settings.
* second smtp server will configure in linux sendmail as the MTA
If it is possible;
May I know how can we pass the alerts and sender info, receiver info to the email?
Thank you
Luke.
Re: Nagios XI alert notification
Posted: Fri Nov 09, 2018 2:46 pm
by benjaminsmith
Hi Luke,
With regards to the first question, Nagios XI only has one configuration for SMTP settings for both email and SMS messages, so this is not currently supported.
As far as creating two notification types at once, this is possible. Core contacts in Nagios use the default sendmail/postfix included in CentOS. It's possible to configure sendmail/postfix or another MTA to use SMTP (for example see:
https://devops.profitbricks.com/tutoria ... -centos-7/). Core contacts use the the notify-host-by-email and notify-service-by-email commands found in commands.cfg
Code: Select all
define command {
command_name notify-host-by-email
command_line /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$
}
The following document on how to configure core contacts to use the Nagios XI PHPmailer SMTP settings outlines how to configure notification commands and update contact templates .
https://assets.nagios.com/downloads/nag ... Mailer.pdf
also can we send only WARNING alerts via email and CRITICAL alerts via SMS?
Yes. This can be set in the host_notification_option and service_notification_option in the contact template or in Notification Management.
Re: Nagios XI alert notification
Posted: Fri Nov 09, 2018 6:32 pm
by lukedevon
Thank you Benjamin,
Your guide is really helpful. Thank you once again.
Re: Nagios XI alert notification
Posted: Sun Nov 11, 2018 11:02 am
by lukedevon
Hi Benjamin,
I have configured and tested according to your guide.
These are the notifications command I have assigned. There is no any other commands.
notify_host_xi_contact
notify_service_xi_contact
** nagios smtp configurations pointed to remoteserver_1:587
** postfix MTA pointed to remoteserver_2:25
However when I do the testing, Alert will receive only by remoteserver_1:587
Since I need to send the same alert to both SMTP servers, then I have assigned,
notify_host_xi_contact
notify_service_xi_contact
notify-host-by-email
notify-service-by-email
and tested.
Then both remote SMTP servers are receiving the message but I am getting following error in /var/log/messages
nagios: job 0 (pid=26001): read() returned error 11
Could you please help me to resolve this issue? or have I done anything wrong here?
Thank you
Luke.
Re: Nagios XI alert notification
Posted: Mon Nov 12, 2018 11:52 am
by benjaminsmith
Then both remote SMTP servers are receiving the message but I am getting following error in /var/log/messages
nagios: job 0 (pid=26001): read() returned error 11
Hi Luke,
It sounds like the messages are working but your getting that error message.Is this correct. Also, what version of Nagios XI and Core are you using?
Re: Nagios XI alert notification
Posted: Mon Nov 12, 2018 12:01 pm
by lukedevon
Hi Benjamin,
Yes, you are correct. I am receiving the message but with that error message in the /var/log/messages. Customer worried about it and we are unable to close the UAT.
I am using the latest version of Nagios XI. installed from xi-latest.tar.gz a few days ago.
Thank you
Luke
Re: Nagios XI alert notification
Posted: Mon Nov 12, 2018 12:56 pm
by benjaminsmith
Hi Luke,
I looked around a bit and this error has come up before ( see:
https://github.com/NagiosEnterprises/na ... issues/172), and has been closed as it's not really a bug.
I would also check your permissions and make sure the notifications are being sent using the nagios user account.