Hide hosts from user in status cgi

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
m_verafin
Posts: 3
Joined: Thu Nov 08, 2012 3:31 pm

Hide hosts from user in status cgi

Post by m_verafin »

Using latest Nagios core on Ubuntu 12.04 (precise)

I have created a user in htpasswd.users. I think set this user up to be a contact for 2 hosts. The first host is the only host in host group A. The second host is one of many hosts in host group B. When I log into the Nagios core website as this new user, and I go to Host Groups page, I expected to see both host group A and B, with one host showing in each group. The Nagios core documentation states that for status.cgi "If you are an authenticated contact you can view all hosts and services for which you are a contact.". However I only see host group A. I'm guessing that is because all the hosts in host group A (there is only one) have that user set as a contact. How can I configure Nagios so that this user sees his 2 hosts?

I could create a new host group based on B that contains just the one host for the user. But then the admin user who has permission to view all hostgroups will have to see all these 'work around' host groups.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Hide hosts from user in status cgi

Post by jsmurphy »

The user can see both hosts, he just can't see both hostgroups if that makes sense. So if you log in as that user and type the group B device in quick search it should appear.

A user can only see a hostgroup if that user has visibility of all hosts in that group. Hopefully this helps.
m_verafin
Posts: 3
Joined: Thu Nov 08, 2012 3:31 pm

Re: Hide hosts from user in status cgi

Post by m_verafin »

So it is an all or nothing situation? The user can either be a contact for all hosts in a host group to see that host group in the status cgi, otherwise he sees none of the hosts from that hostgroup? I would have thought there would be a configuration option to just display the hosts in a hostgroup that a user is allowed to see. I guess I'll have to make new hostgroups for each user I create so that they can see their hostgroups properly. Other than this though, I find Nagios core is able to handle our needs very well.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Hide hosts from user in status cgi

Post by jsmurphy »

Yes it's an all or nothing situation from a hostgroup point of view... although this bit:
...otherwise he sees none of the hosts from that hostgroup?
Isn't explicitly true... they can still see all of the the hosts individually... just not as a hostrgroup.
Locked