Restricting a webuser to view specific host and their servic

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
diwakar0304
Posts: 28
Joined: Tue Nov 04, 2014 4:19 am

Restricting a webuser to view specific host and their servic

Post by diwakar0304 »

Hello,

I need help to configure solution to integrate a web front end user to monitor specific host and their services.
For eg : -
User 1 can view/monitor/alter host 1,2 and services related to host 1,2. Not able to view/monitor/alter host 3,4 and services related to host 3,4.
User 2 can view/monitor/alter host 3,4 and services related to host 3,4. Not able to view/monitor/alter host 1,2 and services related to host 1,2.
Admin user (nagiosadmin) can view all the host and their services.

My current setup is built with following source codes
Nagios-core 4.0.8
nagios plugin 2.0.3
nrpe 2.12
Theme vautour_style
pnp4nagios-0.6.24

I hope that i have elaborate the requirement in easy way to understand.
It will be very helpful if there any documentation or guidance to fulfill the requirement .

BR//
Diwakar
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Restricting a webuser to view specific host and their se

Post by Box293 »

This document is for Nagios XI multi tenancy however I'm pretty sure the same concepts applies for Nagios Core.

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
diwakar0304
Posts: 28
Joined: Tue Nov 04, 2014 4:19 am

Re: Restricting a webuser to view specific host and their se

Post by diwakar0304 »

Hello,

Thanks Box293 for your inputs.

I have added new user "abc" in htpasswd.users
=============================================
Then updated new contact in contacts.cfg :

define contact {
contact_name abc
alias abc Team
host_notification_options d,u,r,f,n
service_notification_options w,u,c,r,f,n
email abc@labc.com
host_notification_period 24x7
service_notification_period 24x7
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
}

=============================================
Updated new contact group :

define contactgroup {
contactgroup_name abc group
alias abc Team
members abc
}

=============================================
In Hosts.cfg changed "contact_groups". Same also updated in services.cfg too.

define host {
host_name hostname
alias portal server
address xxx.xxx.xxx.xxx
check_command check-host-alive
notification_interval 15
notification_options d,u,r
max_check_attempts 3
active_checks_enabled 1
passive_checks_enabled 0
notifications_enabled 1
check_period 24x7
notification_period 24x7
contact_groups abc group
use Default_monitor_server,Default_timeperiod_interval_10,Default_timeperiod_interval_5,host-pnp
icon_image_alt Sun Solaris
icon_image sunlogo.gif
statusmap_image sunlogo.gd2

}

=============================================

cgi.fg : removed # and updated to below line.

authorized_for_read_only=abc

==============================================

Like this I have added 3 user to access Nagios frontend to access their specific hosts in read only mode.


Any thing else need to be done here ???

BR//
Diwakar
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Restricting a webuser to view specific host and their se

Post by Box293 »

Is it working as expected? Do they only see what they are supposed to?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
diwakar0304
Posts: 28
Joined: Tue Nov 04, 2014 4:19 am

Re: Restricting a webuser to view specific host and their se

Post by diwakar0304 »

Yes, it is working for read only mode.
How to give permission to a particular user to use external command interface for their specific host. Is changes require in cgi.cfg only for the same???
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Restricting a webuser to view specific host and their se

Post by slansing »

If you are interested in CGI user control options, I'd take a look at:

http://nagios.sourceforge.net/docs/3_0/configcgi.html
diwakar0304
Posts: 28
Joined: Tue Nov 04, 2014 4:19 am

Re: Restricting a webuser to view specific host and their se

Post by diwakar0304 »

Thanks, this works. You can lock the thread.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Restricting a webuser to view specific host and their se

Post by abrist »

Locked :)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked