Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to allow a user in Nagios to view the status of some servers, but not disable/enable anything?

share|improve this question
Kindly refer below url to add new user for nagioswebinterface…… – Chethan anchan Mar 31 at 5:24
up vote 5 down vote accepted

In /usr/local/nagios/etc/cgi.cfg (or wherever it lives on your system) define the read-only users:

# A comma-delimited list of usernames that have read-only rights in
# the CGIs.  This will block any service or host commands normally shown
# on the extinfo CGI pages.  It will also block comments from being shown
# to read-only users.


Of course, viewer must be first defined as contact with an appropriate htpasswd authentication. In the service/host detail page, the right hand side where you usually have commands will say:

Your account does not have permissions to execute commands.

share|improve this answer

If I understand your question correctly you would like to add users to nagios that can only see some of the servers and have no authority to do any of the administration tasks ( Start / Stop monitoring or alerting ).

To accomplish this you will need to add a user to the .htpasswd file for nagios and then create a contact in nagios with the contact_name matching the username set in .htpasswd and then add that contact only to the hosts which you want them to see. Remember that when you add things to the host configuration that are also defined in the template that it overrides the template instead of adding to it so you will need to also add back any contacts that host already has in the template.

share|improve this answer

In your cgi.cfg file, there are the following lines:



Normally these are configured as above, so all users can at least view all your hosts and services. So if you add your new user to your htpasswd file, they should get the desired behaviour by default.

share|improve this answer
Those lines are configured only for main admins. – Kazimieras Aliulis Feb 9 '10 at 9:08
I don't understand - Nagios has no concept of a "main admin", only the named administrators in the htpasswd file or whichever authentication scheme Apache is configured to use. The directives in cgi.cfg dictate exactly what these users can do. The above directives control who can view services and hosts, and by default that is every user. Perhaps you can say a little more about what you're after? – Cawflands Feb 9 '10 at 9:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.