Page 1 of 2

Problems getting alerts on email

Posted: Mon May 31, 2021 1:13 pm
by sahilrana
Hi Team,

So I am trying to get alert notifications on email using service group. I followed the below steps.

1. Created a service group for disk space and added disk space service from servers.
2. Created a contact with below details
(a) Contact name and email address
(b) Under alert settings enabled host and service notifications, selected host notification options = Down and Service notification options = critical, Manage host notification commands = notify-host-by-email, Manage service notification commands = notify-service-by-email. There is nothing under host notification timeperiod and service notifiction timeperiod.
3. Under bulk modification tool added this contact to the service group for disk space mentioned above.

I am not getting the alerts on email after following the above steps. Do you think I am missing some step here?

Re: Problems getting alerts on email

Posted: Tue Jun 01, 2021 1:01 pm
by dchurch
Try doing this:
1. Under the Contact's Common Settings tab, click the Manage Contact Templates button.
2. Select xi_contact_generic from the left partition, then click Add Selected button.
3. Click the Close button near the bottom-right of the dialog box.

Then under the Alert Settings tab, clear out the Host and Service notification commands using the Manage Host/Service Notification Commands buttons to clear the lists. These will now come from the xi_contact_generic template we set in the above steps.

Then click Save and re-apply config.

When you do this, this uses the hierarchy of settings to apply the "sane default" for notifications. It fixes most problems having to do with not receiving notifications.

Re: Problems getting alerts on email

Posted: Wed Jun 02, 2021 7:20 am
by sahilrana
So xi_contact_generic was already there under Manage contact templates.
I removed host and service notification commands.
Saved and reapplied config.

That didn't change anything. Still not getting any alert on my email.

Re: Problems getting alerts on email

Posted: Wed Jun 02, 2021 4:10 pm
by ssax
Please PM me a copy of your profile, you can download it from Admin > System Profile by clicking the Download Profile button.

Re: Problems getting alerts on email

Posted: Thu Jun 03, 2021 1:18 pm
by sahilrana
I sent you the profile copy in PM.
It's showing in my outbox and not sent folder. Can you confirm if you have received it?

Re: Problems getting alerts on email

Posted: Fri Jun 04, 2021 11:38 am
by dchurch
We have received it. We're just doing some digging into your configuration at the moment.

Re: Problems getting alerts on email

Posted: Fri Jun 04, 2021 11:41 am
by dchurch
What's the name of the contact you're trying this on?
What's the name of the host and service you're trying this on?
What's the name of the service group?

Does it work to add the contact you created manually to the service's list of contacts?

Re: Problems getting alerts on email

Posted: Mon Jun 07, 2021 8:12 am
by sahilrana
What's the name of the contact you're trying this on? - sahilmilliman
What's the name of the host and service you're trying this on?
What's the name of the service group? - name of the servicegroup is C Drive summary - All servers

Does it work to add the contact you created manually to the service's list of contacts? - Do you mean adding the contact directly to the service? I tried that but didnt get alert.

Re: Problems getting alerts on email

Posted: Mon Jun 07, 2021 3:41 pm
by ssax
That contact is currently using the xi_contact_generic contact template:

Code: Select all

define contact {
    contact_name                     sahilmilliman
    use                              xi_contact_generic
But there is no associated user of the same name in Admin > Manage Users. The xi_contact_generic contact template makes it so the contact uses xi_host_notification_handler and xi_service_notification_handler commands, those will not work without an associated user in Admin > Manage Users that has the exact same username as the contact_name.

You have a few options:

1. You can add a user in Admin > Manage Users with the same username as the contact_name.

2. OR you can edit the Contact, click Manage Templates, and change it to use generic-contact instead of xi_contact_generic. That will make the contact use the notify-host-by-email and notify-service-by-email commands for sending notifications, these do not require an XI user but in order for them to work you would need to make sure your backend MTA (likely postfix in this case) is setup to relay to your mail server:

If you choose this method, change your.mail.server to what you have in Admin > Email Settings in the XI server before running the commands below:

Code: Select all

echo 'relayhost = [your.mail.server]:25' >> /etc/postfix/main.cf
systemctl restart postfix
3. OR you can follow this guide to setup your core contacts to use XI's PHP Mailer functionality:

https://assets.nagios.com/downloads/nag ... Mailer.pdf


See here as well:

https://assets.nagios.com/downloads/nag ... ntacts.pdf

Re: Problems getting alerts on email

Posted: Tue Jun 08, 2021 3:01 am
by sahilrana
ok.. I am not sure if the changing mail server settings would fix it.
Can you please compare these two contacts and let me know if there is any difference on how they are setup?

1. Medinsightsupport - Alerts are working fine for this contact.
2. sahilmilliman - Alerts are not working for this contact.

I compared both and I dont see any difference on how they are configured.