Nagios XI alert notification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lukedevon
Posts: 143
Joined: Sat Mar 24, 2018 9:15 am

Nagios XI alert notification

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI alert notification

Post 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.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
lukedevon
Posts: 143
Joined: Sat Mar 24, 2018 9:15 am

Re: Nagios XI alert notification

Post 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
lukedevon
Posts: 143
Joined: Sat Mar 24, 2018 9:15 am

Re: Nagios XI alert notification

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI alert notification

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
lukedevon
Posts: 143
Joined: Sat Mar 24, 2018 9:15 am

Re: Nagios XI alert notification

Post by lukedevon »

Thank you Benjamin,
Your guide is really helpful. Thank you once again.
lukedevon
Posts: 143
Joined: Sat Mar 24, 2018 9:15 am

Re: Nagios XI alert notification

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI alert notification

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
lukedevon
Posts: 143
Joined: Sat Mar 24, 2018 9:15 am

Re: Nagios XI alert notification

Post 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
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios XI alert notification

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked