[Solved] Filtered View of Hosts/Services per User


#1

Hi, I’ve been using Nagios for a while but always logging in against .htpasswd as nagiosadmin. I have now switched to logging in against ldap (active directory) and it works fine except that I would like each user/contact to see only their own hosts and services. At the moment when I log in I see all hostws and services.
In my contacts.cfg I have:
define contact{
contact_name 7654321
use generic-contact
alias Alan
email [email protected]
}
define contact{
contact_name 1234567
use generic-contact
alias Jonny
email [email protected]
}
In my hosts.cfg I have:
define host{
use linux-server,pnp-hst
host_name red
alias red
address 192.168.8.88
contacts 1234567
}
define host{
use linux-server,pnp-hst
host_name blue
alias blue
address 192.168.8.89
contacts 7654321
}
So when logged in as their user numbers Jonny should see red and Alan should see blue.
I have checked phpinfo(); and I show up with the correct _SERVER"REMOTE_USER"]

Has anyone any ideas on how I can get this sorted? Or would Icinga handle this any better?
Thanks in advance,
jonny


#2

My problem was in the cgi.cfg file. I had replaced some of the authorized_for variables e.g. from:
authorized_for_system_information=nagiosadmin
to:
authorized_for_system_information=*
I needed to replace that again with the names of the logged in users e.g.:
authorized_for_system_information=alan,jonny…
Afte that the filtered viewing per user works as it should.
All the Best,
jonny