Contact vs Contact Groups

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Contact vs Contact Groups

Post 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.
You do not have the required permissions to view the files attached to this post.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Contact vs Contact Groups

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Contact vs Contact Groups

Post 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):

Code: Select all

=> brunob
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:

Code: Select all

tail -20 /var/log/mysqld.log
Be sure to check out our Knowledgebase for helpful articles and solutions!
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: Contact vs Contact Groups

Post by paulol »

OK, thks guys. Now its clear.
Locked