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

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
maglog1
Posts: 1
Joined: Thu Dec 25, 2014 5:58 am

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

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

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

Post 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
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked