Read Only user creation

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
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Read Only user creation

Post by veenm »

Hi,

I have configured the Nagios Core version 3.5.1 and i want to create a read only access to users to access the nagios web page. How can i create the read only user and provide the access to them.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Read Only user creation

Post by abrist »

You will need to add the user to (or remove them from) the appropriate "authorized_for_*" definitions in cgi.cfg:
http://nagios.sourceforge.net/docs/3_0/cgiauth.html
http://nagios.sourceforge.net/docs/3_0/configcgi.html
Additionally, the user must be named the same as a contact, and that contact must be added to objects (hosts/services/etc) you want the user to see in the web ui.
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.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: Read Only user creation

Post by veenm »

if i create user and add in contact group will that user able to see the Web Gui ? How to create the password for that user and do we have to nagios service once we add that user in cgi file ?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Read Only user creation

Post by slansing »

Though this is an older post it still holds true:

http://www.linuxquestions.org/questions ... ce-607353/

You will have to add the user with basicauth and follow what abrist mentioned, which is also shown in the above post.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: Read Only user creation

Post by veenm »

According to the reply i can summarize as below,

1. Create the contact in contacts.cfg ( example xyz)
2. Add the user and password as below

htpasswd /usr/local/nagios/etc/htpasswd.users xyz

3. Add the user in cgi.cfg file If we want the user "xyz" to have to host and service check information on nagios web gui

default_user_name=xyz


4. Restart the apache

service httpd restart

Please correct me if i am wrong.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Read Only user creation

Post by abrist »

Looks right. You may want to look at the cgi documentation for:

Code: Select all

authorized_for_read_only=xyz
You will still need to configure the contact to be a contact for the objects inquestion or to use the following cgi directives:

Code: Select all

authorized_for_all_hosts=xyz
authorized_for_all_services=xyz
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.
veenm
Posts: 148
Joined: Tue Jun 18, 2013 5:58 am

Re: Read Only user creation

Post by veenm »

please clarify below .

1. creating the contact xyz in contacts.cfg is compulsory or with out creating the contact xyz , user xyz can access nagios gui?
2. to create the users to access the nagios GUI , do we have to have a root access or nagios login is enough ?
3 . restating Apache is compulsory ?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Read Only user creation

Post by abrist »

veenm wrote:1. creating the contact xyz in contacts.cfg is compulsory or with out creating the contact xyz , user xyz can access nagios gui?
It is only compulsory if you do not add the user to one of the authorized_for_all_* directives in cgi.cfg.
veenm wrote:2. to create the users to access the nagios GUI , do we have to have a root access or nagios login is enough ?
You will most likely need root as you will have to add the user to your basic auth file.
veenm wrote:3 . restating Apache is compulsory ?
Anytime you edit the cgi.cfg file, you will need to restart apache for the changes to take affect.
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.
teh0015
Posts: 59
Joined: Tue Jul 07, 2015 9:07 am

Re: Read Only user creation

Post by teh0015 »

abrist wrote:Anytime you edit the cgi.cfg file, you will need to restart apache for the changes to take affect.
This is incorrect.

You will only need to reload/restart Apache if you modify an Apache config file
ie: under /etc/httpd | /etc/apache??

For /<nagios-install>/cgi.cfg (or anything under <nagios-install>) you just need to reload/restart Nagios.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Read Only user creation

Post by tmcdonald »

Thanks for the clarification, but as this thread is quite old I will be closing it now.
Former Nagios employee
Locked