How to restrict to view a hosts_group by contact_group

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

How to restrict to view a hosts_group by contact_group

Postby iam33 » Tue Apr 10, 2018 5:50 am

Hi,
thanks in advance!

How can I restrict/deny to view a hosts_group by some contact_group, when a machine its in more than one hosts_group?

Example:
Code: Select all
      HOSTS_GROUP_A --> CONTACT_GROUP_A
         host1
         host2
         host3
         host4

      HOSTS_GROUP_C --> CONTACT_GROUP_A
         host5
         host6

      HOSTS_GROUP_B --> CONTACT_GROUP_B
         host1
         host2

   The users in CONTACT_GROUP_B, could view ALL the hosts in HOSTS_GROUP_A, because the host1 and host2 are in both. I want that the CONTACT_GROUP_B only view HOSTS_GROUP_B.


thanks!!
iam33
 
Posts: 16
Joined: Mon Mar 18, 2013 5:30 am

Re: How to restrict to view a hosts_group by contact_group

Postby npolovenko » Wed Apr 11, 2018 4:33 pm

@ iam33 , You need to make sure that none of the hosts: host1, host2,host3,host4 have the HOSTS_GROUP_A under "contact_groups". Let me know it works for you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1884
Joined: Mon May 15, 2017 5:00 pm

Re: How to restrict to view a hosts_group by contact_group

Postby iam33 » Thu Apr 19, 2018 3:51 am

Hi!

I have upgrade to 4.3.4 from 4.0.7, because I had read th next:
https://support.nagios.com/forum/viewtopic.php?f=7&t=21794&p=76106&hilit=host+on+more+than+one+hostgroup

that finished in a bug solved:
http://tracker.nagios.org/view.php?id=519&_ga=2.160982461.1885089373.1524038852-2120465477.1517481886

and now the users in contact group CONTACT_GROUP_B only can view their hosts (HOSTS_GROUP_B) and they can view HOSTS_GROUP_A with only hosts host1 and host2.

So I want that they only can view HOSTS_GROUP_B not HOSTS_GROUP_A although these hosts are in HOSTS_GROUP_B and HOSTS_GROUP_A.

Now I have the configuration like this:

Code: Select all
define hostgroup{
        hostgroup_name   HOSTS_GROUP_A
        alias            Servers HOSTS_GROUP_A
        members          host1,host2,host3,host4
        }
      
define hostgroup{
        hostgroup_name   HOSTS_GROUP_C
        alias            Servers HOSTS_GROUP_C
        members          host5,host6
        }
      
define hostgroup{
        hostgroup_name   HOSTS_GROUP_B
        alias            Servers HOSTS_GROUP_B
        members          host1,host2
        }
      
define host{
        use                     servers,host-pnp
        host_name               host1.domain
        alias                   host1
        contact_groups          CONTACT_GROUP_A,CONTACT_GROUP_B
}
      
define host{
        use                     servers,host-pnp
        host_name               host2.domain
        alias                   host2
        contact_groups          CONTACT_GROUP_A,CONTACT_GROUP_B
}
      
define host{
        use                     servers,host-pnp
        host_name               host3.domain
        alias                   host3
        contact_groups          CONTACT_GROUP_A
}
      
define host{
        use                     servers,host-pnp
        host_name               host4.domain
        alias                   host4
        contact_groups          CONTACT_GROUP_A
}
iam33
 
Posts: 16
Joined: Mon Mar 18, 2013 5:30 am

Re: How to restrict to view a hosts_group by contact_group

Postby tacolover101 » Thu Apr 19, 2018 9:18 pm

i'd like to help you, but i'm having a hard time understanding what you're looking to do. any chance you could paint a picture for reference?
User avatar
tacolover101
 
Posts: 402
Joined: Mon Apr 10, 2017 11:55 am

Re: How to restrict to view a hosts_group by contact_group

Postby iam33 » Fri Apr 20, 2018 1:50 am

Basically what I need is to put contact_group in the host_group not in the host, so that a person can only see the host_group that corresponds not the rest. I think this time it was in implementation in old versions.

In the following image attached you can see what a user can see now from the hosts_groups, and he should not be able to see the hosts_group "Servidores Gerencia Seguridad Social (SERVIDORES-GSS)", but since the host" apliexpwl1.jcyl.es "is in both groups, you can see these groups.
Attachments
image004.png
iam33
 
Posts: 16
Joined: Mon Mar 18, 2013 5:30 am

Re: How to restrict to view a hosts_group by contact_group

Postby npolovenko » Fri Apr 20, 2018 3:15 pm

@iam33, I see what you mean. Unfortunately, you can't assign a contact group to a host group. I suggest creating a separate host group for that host check.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1884
Joined: Mon May 15, 2017 5:00 pm

Re: How to restrict to view a hosts_group by contact_group

Postby tacolover101 » Mon Apr 23, 2018 12:07 pm

npolovenko wrote:@iam33, I see what you mean. Unfortunately, you can't assign a contact group to a host group. I suggest creating a separate host group for that host check.


you could, however, assign a contact group and host group to a template, and assign that same template to a host.

just a thought.
User avatar
tacolover101
 
Posts: 402
Joined: Mon Apr 10, 2017 11:55 am

Re: How to restrict to view a hosts_group by contact_group

Postby npolovenko » Mon Apr 23, 2018 1:32 pm

@tacolover101, I've tried that but didn't quite work for me. Still able to see both host groups.

Code: Select all
define host {
       name                                host_template
       hostgroups                          bravo
       contact_groups                      test_contact
       register                          0

}   

define hostgroup {
   hostgroup_name                      bravo
   alias                               bravo
   members                             host1,host2
   }   


   define hostgroup {
   hostgroup_name                      alpha
   alias                               alpha
   members                             host1,host3
   }


   define contactgroup {
   contactgroup_name                   test_contact
   alias                               test_contact
   members                             nik
   }   


Test contact is still able to see alpha and bravo host groups.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1884
Joined: Mon May 15, 2017 5:00 pm

Re: How to restrict to view a hosts_group by contact_group

Postby iam33 » Tue Apr 24, 2018 1:48 am

I undestand that, while It´s not posible assign a contact_group clause to an host_group, this is not posible to do it.

I´m thinking this was posible in older versions ....

do you think will be it posible to do in future versions?
iam33
 
Posts: 16
Joined: Mon Mar 18, 2013 5:30 am

Re: How to restrict to view a hosts_group by contact_group

Postby npolovenko » Tue Apr 24, 2018 2:52 pm

@iam33, I don't think this is on a roadmap... When you grand a user acess to a host he will automatically be able to see all the hostgroups that the host belongs to. You could submit a feature request here if you'd like:
https://github.com/NagiosEnterprises/na ... issues/new
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
npolovenko
Support Tech
 
Posts: 1884
Joined: Mon May 15, 2017 5:00 pm


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 11 guests