Page 1 of 1
Contact vs Contact Groups
Posted: Thu Apr 02, 2015 10:02 am
by paulol
When i see the members of contact group, i see the contacts.
But when i try to see the contacts groups of the contact, cant see. Why?
Following the image, to explaing better.
Re: Contact vs Contact Groups
Posted: Thu Apr 02, 2015 11:08 am
by jdalrymple
The reason for this is because deep under the hood the definition can be placed in one of 2 places, you can assign a contactgroup to a contact, or you can put a contact into a contactgroup. This is illistrated in the bare config below:
contactgroups.cfg
Code: Select all
define contactgroup {
contactgroup_name babar
alias babar
members foo
}
define contactgroup {
contactgroup_name food
alias food
}
contacts.cfg
Code: Select all
define contact {
contact_name bar
contactgroups food
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_test
service_notification_commands notify_test
}
define contact {
contact_name foo
alias foo
service_notifications_enabled 1
host_notification_period foo_notification_times
service_notification_period 24x7
host_notification_options d,u,r,f,s,
service_notification_options w,u,c,r,f,s,
service_notification_commands notify-service-by-email
email [email protected]
use xi_contact_generic
}
The end result is the same, generally managing them in 1 spot (usually "placing contacts into contactgroups") is advised for consistency and maintainability.
Re: Contact vs Contact Groups
Posted: Thu Apr 02, 2015 11:15 am
by lmiltchev
The relationship could be defined two ways:
Code: Select all
CCM->Contacts->contact->Manage Contact Groups->Add Selected
or
Code: Select all
CCM->Contact Groups->contactgroup->Manage Contacts->Add Selected
If a contact has been added to a contact group via the second method, under the "Contact Management ("Contactgroups" section) you should see the following entry (grayed out):
and nothing under "Assigned" section.
Have you tried searching for "brunob" in the "Contactgroups" search bar? Have you reviewed the actual configs to see how the contact/contactgroup has been defined?
Code: Select all
cat /usr/local/nagios/etc/contacts.cfg
cat /usr/local/nagios/etc/contactgroups.cfg
You can also check for errors in the mysqld.log to rule out database corruption:
Re: Contact vs Contact Groups
Posted: Thu Apr 02, 2015 1:01 pm
by paulol
OK, thks guys. Now its clear.