Differant Issues with Contacts and Notifications
-
[email protected]
- Posts: 12
- Joined: Wed Feb 06, 2013 9:20 am
Differant Issues with Contacts and Notifications
I'm recently been evaluating XI for our University and ran into some issues with using contacts and sending out alerts.
Not sending Alerts Issue:
When I first setup a user account, it created a contact user with the same ID. I'm assuming there might be a link between the two accounts? To test alerts, I setup a server to block pings. When I use the contact that was created through creating a new user account, I am able to receive emails and pages. I made a copy of that contact and renamed it. If I change the host and the ping service that fails to use the new contact and removed the orginal one, I no longer receive emails and alerts. I am unable to figure out why not.
I have noticed under Core Configuration > Clients, Service Templates, Service Escalation and Time Period all have in red "Apply Configuration for new changes to take effect" even though I select the "Apply Configuraton" button and I don't have any errors. I look at the good snapshot, but don't find anything in the snapshot log file. I don't see the red message for the other sections like Contact Groups, Host templates, etc..
I'm also confused on how I can go into my user account (not a contact) and manage Notfications for that account and I can disable notifications for both hosts and services with one check box selection. I access these settings under Configuration > My Account settings. I thought contacts was the accounts that sends out alerts and notifications. If I go into the Contact properties > Alert Settings > and set Notification to off for both host and service doesn't stop notifications. Not sure if this is all related.
My goal is to setup multable contacts for each person based on priority (high, get email and page / medium, email only).
Thx,
Don
Not sending Alerts Issue:
When I first setup a user account, it created a contact user with the same ID. I'm assuming there might be a link between the two accounts? To test alerts, I setup a server to block pings. When I use the contact that was created through creating a new user account, I am able to receive emails and pages. I made a copy of that contact and renamed it. If I change the host and the ping service that fails to use the new contact and removed the orginal one, I no longer receive emails and alerts. I am unable to figure out why not.
I have noticed under Core Configuration > Clients, Service Templates, Service Escalation and Time Period all have in red "Apply Configuration for new changes to take effect" even though I select the "Apply Configuraton" button and I don't have any errors. I look at the good snapshot, but don't find anything in the snapshot log file. I don't see the red message for the other sections like Contact Groups, Host templates, etc..
I'm also confused on how I can go into my user account (not a contact) and manage Notfications for that account and I can disable notifications for both hosts and services with one check box selection. I access these settings under Configuration > My Account settings. I thought contacts was the accounts that sends out alerts and notifications. If I go into the Contact properties > Alert Settings > and set Notification to off for both host and service doesn't stop notifications. Not sure if this is all related.
My goal is to setup multable contacts for each person based on priority (high, get email and page / medium, email only).
Thx,
Don
Re: Differant Issues with Contacts and Notifications
Did you have a chance to go through these steps, outlined on our wiki page?
Hope this helps.
Are you php and system time in sync? You can view this by going to: Admin->System ProfileI have noticed under Core Configuration > Clients, Service Templates, Service Escalation and Time Period all have in red "Apply Configuration for new changes to take effect"...
You can enable/disable notifications globally, on the user level, or on the host/service level. The easiest way to disable notifications on ALL services on a host (and on the host itself) is to go to: Home->Host Detail->click on your host->Advanced tab->See this host in Nagios Core->Disable notifications for all services on this host->Disable For Host Too->CommitI'm also confused on how I can go into my user account (not a contact) and manage Notfications for that account and I can disable notifications for both hosts and services with one check box selection.
Hope this helps.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
[email protected]
- Posts: 12
- Joined: Wed Feb 06, 2013 9:20 am
Re: Differant Issues with Contacts and Notifications
First, thank you for the quick response!!
I first found that PHP and System time was not in sync. I made the change to /etc/php.ini and this did fix the “Apply Configuration…” message to go away and fixed missed sync issues.
I also found out why I wasn’t able to disable notification at the contact user level. It appears the linked contact by default had two variables settings: host_notifications_enabled = 1 and service_notifications_enable = 1. Once I removed them, I could stop notifications at the contact user level.
But, I still can’t create a new contact and have it send out notifications.
Here is what I have attempted:
The linked contact user:
The contact that is linked to my user account is working at the host level when the server is in a DOWN state. I receive the notifications.
I did find some difference based on the t-shooting document and the pdf file “Nagios XI – Users and Contact” that you provided. I first couldn’t find the settings for Host Commands and Service Commands. I did find it in the Legacy CCM. When I select the notepad (the scroll window is grey out), there wasn’t anything selected. Even though the document said two handlers was needed to link the two accounts. But to test I did add xi_host_notification_handler to Host Commands and xi_service_notification_handler to Service Commands. I was still able to receive notification, no change in state. Possable the template applies the two handles, but doesn't display the setting change in the GUI?
I tried one more step and replace the settings to notify-host-by-email and notify-service-by-email. Once this was applied, Notifications stopped completely. This would be the same issue I’m having when I create a new contact.
To test again, the link between the accounts, I removed the Host and Service commands, I put it back to the state I first found the contact in (nothing selected). I then disable notifications at the Logged in as: account and I was able to disable the notifications. I was expecting to break the link between the two accounts, since I had not selected the two handlers? I’m thinking the template is providing the setting, but doesn’t show it being applied in the GUI?
I went ahead and put the two handles back based on the documentation and notifications kept working as expected.
Additional Settings:
Time Period 24x7
Host and Service notified is enabled (on)
Host and Service Options = enabled d,u,r,f,s
No Free variable definitions
Active = enable
Template: xi_contact_generic
Non-Linked Contact:
I made copy of the contact above – But still do not get any notifications.
I did modify the Host and Service Commands to notify-host-by-email and notify-service-by-email
To test, I also tried xi_host_notification_handler and xi_service_notification_handler. I didn’t expect this to work since the contact name isn’t the same as my user account, but thought I would give it a try… I also tried having both commands in each one. It did not work.
Additional settings for the non-linked contact:
Time Period 24x7
Host and Service notified is enabled (on)
Host and Service Options = enabled d,u,r,f,s
Active = enable
There were no Free variable definitions, but I also tried: host_notifications_enabled = 1 and service_notifications_enable = 1, did not work
Templates:
Tried xi_contact_generic
Tried generic-contact
Tried both at the same time, also changed the priority.
I tried creating a new contact using the Legacy CCM. The New contact doesn’t send out emails or pages.
It appears the only time I can get a contact to work is if it is linked to a user account with the same ID name.
I first found that PHP and System time was not in sync. I made the change to /etc/php.ini and this did fix the “Apply Configuration…” message to go away and fixed missed sync issues.
I also found out why I wasn’t able to disable notification at the contact user level. It appears the linked contact by default had two variables settings: host_notifications_enabled = 1 and service_notifications_enable = 1. Once I removed them, I could stop notifications at the contact user level.
But, I still can’t create a new contact and have it send out notifications.
Here is what I have attempted:
The linked contact user:
The contact that is linked to my user account is working at the host level when the server is in a DOWN state. I receive the notifications.
I did find some difference based on the t-shooting document and the pdf file “Nagios XI – Users and Contact” that you provided. I first couldn’t find the settings for Host Commands and Service Commands. I did find it in the Legacy CCM. When I select the notepad (the scroll window is grey out), there wasn’t anything selected. Even though the document said two handlers was needed to link the two accounts. But to test I did add xi_host_notification_handler to Host Commands and xi_service_notification_handler to Service Commands. I was still able to receive notification, no change in state. Possable the template applies the two handles, but doesn't display the setting change in the GUI?
I tried one more step and replace the settings to notify-host-by-email and notify-service-by-email. Once this was applied, Notifications stopped completely. This would be the same issue I’m having when I create a new contact.
To test again, the link between the accounts, I removed the Host and Service commands, I put it back to the state I first found the contact in (nothing selected). I then disable notifications at the Logged in as: account and I was able to disable the notifications. I was expecting to break the link between the two accounts, since I had not selected the two handlers? I’m thinking the template is providing the setting, but doesn’t show it being applied in the GUI?
I went ahead and put the two handles back based on the documentation and notifications kept working as expected.
Additional Settings:
Time Period 24x7
Host and Service notified is enabled (on)
Host and Service Options = enabled d,u,r,f,s
No Free variable definitions
Active = enable
Template: xi_contact_generic
Non-Linked Contact:
I made copy of the contact above – But still do not get any notifications.
I did modify the Host and Service Commands to notify-host-by-email and notify-service-by-email
To test, I also tried xi_host_notification_handler and xi_service_notification_handler. I didn’t expect this to work since the contact name isn’t the same as my user account, but thought I would give it a try… I also tried having both commands in each one. It did not work.
Additional settings for the non-linked contact:
Time Period 24x7
Host and Service notified is enabled (on)
Host and Service Options = enabled d,u,r,f,s
Active = enable
There were no Free variable definitions, but I also tried: host_notifications_enabled = 1 and service_notifications_enable = 1, did not work
Templates:
Tried xi_contact_generic
Tried generic-contact
Tried both at the same time, also changed the priority.
I tried creating a new contact using the Legacy CCM. The New contact doesn’t send out emails or pages.
It appears the only time I can get a contact to work is if it is linked to a user account with the same ID name.
Re: Differant Issues with Contacts and Notifications
Yes, the names must be the same.It appears the only time I can get a contact to work is if it is linked to a user account with the same ID name.
The preferred way in XI would be to use "users", instead of "contacts". Try adding a user via:
Admin->Manage Users->Add New User->Create as Monitoring Contact->Fill in the form->Add User
Note: Use a name, that you don't use already as a contact.
Add this user as a monitoring contact to a host/service and see if you are going to receive alerts.
Can you post the contact definition of a monitoring contact that doesn't receive notifications? It may look something like this:
Code: Select all
define contact {
contact_name contact
alias contact
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
email [email protected]
use generic-contact
}Be sure to check out our Knowledgebase for helpful articles and solutions!
-
[email protected]
- Posts: 12
- Joined: Wed Feb 06, 2013 9:20 am
Re: Differant Issues with Contacts and Notifications
This is the original working contact when I created my admin user account. This one has been working from the start.
Created a new user account and checked marked to create a managed contact (note, no place to add pager number), then added the contact to the host and service that is failing. I started to receive emails only. I then manually enter the pager number in contacts only, this didn’t start the text paging. So I had to log off then log on with the new user account and add the pager number to the managed user. Note, there are no handlers by default and variables were set by default to enable notifications, note the double entries.
Here is the configuration file for the contact only, no link to a user account.
Code: Select all
define contact {
contact_name don-admin
alias Don Admin
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period don-admin_notification_times
service_notification_period don-admin_notification_times
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
email [email protected]
pager 804539xxx
use xi_contact_generic
}
Code: Select all
define contact {
contact_name don
alias Don B.
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period don_notification_times
service_notification_period don_notification_times
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
email [email protected]
pager 804539xxx
host_notifications_enabled 1
service_notifications_enabled 1
use xi_contact_generic
}
Code: Select all
define contact {
contact_name don_high
alias don_high
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period xi_timeperiod_24x7
service_notification_period xi_timeperiod_24x7
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
email [email protected]
pager 804539xxxx
host_notifications_enabled 1
service_notifications_enabled 1
use generic-contact
}
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Differant Issues with Contacts and Notifications
It looks like you are changing the following which will totally change how messages are sent out
working
not working
working
Code: Select all
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handlerCode: Select all
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email-
[email protected]
- Posts: 12
- Joined: Wed Feb 06, 2013 9:20 am
Re: Differant Issues with Contacts and Notifications
I changed the notification commands, but still didn't work, until I created a user account with the same user ID. Still not able to create a standalone contact.
Our goal for the monitoring software is very basic and that we would like to send an alert to different contacts based on alert level; high alerts would send an email and text message 24x7, medium level will be emails during working hours only. Low would not send emails during holidays. My goal was to setup a single user, but create 2 or more contacts for that user to use. I can also manage all the contacts with my admin account (force enable notifications and force settings), but I don't appear to be able to manage all the user accounts settings without having to log in with that account. (IE: adding/modifying pager numbers, forcing notification to be enable and another layer for notification options and have to manage passwords, etc..). Any suggestions would be greatly appreciated. My attempt is to keep it as simple to manage as possible.
Code: Select all
define contact {
contact_name don_high
alias don_high
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period xi_timeperiod_24x7
service_notification_period xi_timeperiod_24x7
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
email [email protected]
pager 804539xxxx
use xi_contact_generic
}
How would you setup a generic contact that can send emails and pages from Nagios XI? It does appear from Nagios Exchange plugins and online documents that I should be able to create just a contact without it being linked to a user account?The preferred way in XI would be to use "users", instead of "contacts"
Our goal for the monitoring software is very basic and that we would like to send an alert to different contacts based on alert level; high alerts would send an email and text message 24x7, medium level will be emails during working hours only. Low would not send emails during holidays. My goal was to setup a single user, but create 2 or more contacts for that user to use. I can also manage all the contacts with my admin account (force enable notifications and force settings), but I don't appear to be able to manage all the user accounts settings without having to log in with that account. (IE: adding/modifying pager numbers, forcing notification to be enable and another layer for notification options and have to manage passwords, etc..). Any suggestions would be greatly appreciated. My attempt is to keep it as simple to manage as possible.
Re: Differant Issues with Contacts and Notifications
If you need to create "contacts only" (not users), you can do this by going to the Core Config Manager->Alerting->Contacts->Add New
Under the Common Settings tab
Fill in contact name, description, and email address, select the "generic-contact" template.
Under the Alert Settings tab
Host/Service Notifications Enabled = on or skip
Select Host/Service Notifications Timeperiod from the drop-down menus
Select Host/Service Notification options
Click on "Manage Host Notification Commands" and select "notify-host-by-email"
Click on "Manage Service Notification Commands" and select "notify-service-by-email"
Click on "Save" and Apply Configuration.
Add the newly created contact to a host or a service:
CCM->Hosts/Services->Modify->Alert Settings->Manage Contacts
Save and Apply Configuration
Test alerts to make sure the contact is getting emails:
Home page->Host/Service Details->click on the host/service->Advanced tab->Send custom notification
Check email. If you don't see it in the Inbox, check the Spam folder, in case it ends up there.
Under the Common Settings tab
Fill in contact name, description, and email address, select the "generic-contact" template.
Under the Alert Settings tab
Host/Service Notifications Enabled = on or skip
Select Host/Service Notifications Timeperiod from the drop-down menus
Select Host/Service Notification options
Click on "Manage Host Notification Commands" and select "notify-host-by-email"
Click on "Manage Service Notification Commands" and select "notify-service-by-email"
Click on "Save" and Apply Configuration.
Add the newly created contact to a host or a service:
CCM->Hosts/Services->Modify->Alert Settings->Manage Contacts
Save and Apply Configuration
Test alerts to make sure the contact is getting emails:
Home page->Host/Service Details->click on the host/service->Advanced tab->Send custom notification
Check email. If you don't see it in the Inbox, check the Spam folder, in case it ends up there.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
[email protected]
- Posts: 12
- Joined: Wed Feb 06, 2013 9:20 am
Re: Differant Issues with Contacts and Notifications
I finally found the issue. I found that the standalone contact doesn't use the Nagio XI for the mail relay server settings in Admin > Manage Email Settings > SMTP Settings > Host.
I had to modify the setting for the email service running on the OS. On the Nagios VMWare version, I modified /etc/postfix/main.cf and updated the following setting relayhost=smtp-server.domain.com. I was able to send notifications with the standalone contact.
Thank you for your help, the information you provided was very helpful!
Don
I had to modify the setting for the email service running on the OS. On the Nagios VMWare version, I modified /etc/postfix/main.cf and updated the following setting relayhost=smtp-server.domain.com. I was able to send notifications with the standalone contact.
Thank you for your help, the information you provided was very helpful!
Don