Page 1 of 1

Read only user to be created for users to access nagios GUI

Posted: Wed Apr 15, 2015 6:15 am
by maglog1
Hello,

I have one admin user nagiosadmin to access nagios GUI.

But want another just read only user which is able to access Nagios.

Can someone help me out as to how to create the read-only user for the same.

Regards,
Shreyansh

Re: Read only user to be created for users to access nagios

Posted: Wed Apr 15, 2015 9:52 am
by jolson
First, generate a new htaccess file for your read-only user:

Code: Select all

htpasswd -c /root/readuser.txt readuser

This creates a file in /root called readuser.txt:

Code: Select all

cat /root/readuser.txt
readuser:abcdefg.1234567

Cat that file, and append the output to /usr/local/nagios/etc/htpasswd.users

Code: Select all

cat /root/readuser.txt >> /usr/local/nagios/etc/htpasswd.users
Now test access with that user on your Nagios web GUI.

Note that the user does not yet have any permissions.

To provide readuser with proper permissions, edit your nagios cgi file:

Code: Select all

vi /usr/local/nagios/etc/cgi.cfg
Look for the directives:

Code: Select all

authorized_for_all_services=nagiosadmin
authorized_for_all_hosts=nagiosadmin
Add the new user:

Code: Select all

authorized_for_all_services=nagiosadmin,readuser
authorized_for_all_hosts=nagiosadmin,readuser
Now, you need to restart the Nagios daemon.

Code: Select all

service nagios restart
Test to ensure that the user is read-only and you should be good to go.

Best,

Jesse