Page 1 of 1

Read Only user creation

Posted: Wed Nov 06, 2013 12:37 pm
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.

Re: Read Only user creation

Posted: Wed Nov 06, 2013 2:15 pm
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.

Re: Read Only user creation

Posted: Wed Nov 06, 2013 2:32 pm
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 ?

Re: Read Only user creation

Posted: Wed Nov 06, 2013 2:46 pm
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.

Re: Read Only user creation

Posted: Wed Nov 06, 2013 3:29 pm
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.

Re: Read Only user creation

Posted: Wed Nov 06, 2013 3:35 pm
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

Re: Read Only user creation

Posted: Thu Nov 07, 2013 9:36 am
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 ?

Re: Read Only user creation

Posted: Thu Nov 07, 2013 1:00 pm
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.

Re: Read Only user creation

Posted: Thu May 05, 2016 8:54 am
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.

Re: Read Only user creation

Posted: Thu May 05, 2016 9:04 am
by tmcdonald
Thanks for the clarification, but as this thread is quite old I will be closing it now.