Add an user access to Nagios web interface

Mission: Give access to the Nagios web interface.

First, create a new user.
On the Nagios server:

# htpasswd /etc/nagios3/htpasswd.users newusername

htpasswd.users might be located somewhere else (you can use the locate command to find it) and you might also use htpasswd2 instead of htpasswd.

– I’m not sure it’s necessary but I did it:

/etc/init.d/apache2 reload

Then you have 2 options:

  • Option #1: you allow your user to view only specific hosts. In this case, if you enabled external commands in the Nagios configuration, your user will also be allowed to execute commands through the Nagios interface.
  • Option #2: you allow your user to view all hosts. In this case you can unauthorized the execution of external commands for this user.

You can find explanations in the official documentation : http://nagios.sourceforge.net/docs/3_0/cgiauth.html

Implementation of the Option #1:
– Create a contact user with the same username than the one you used in the htpasswd command
– Add the contact for each Host you want him to access (don’t need to add the contact at the service level, if it is a contact for a host, he can also view all the services associated to this host)
– Reload Nagios

Implementation of the Option #2:
– Modify the cgi.cfg file to give the user (use the same name as the one you used in the htpasswd command) the rights of :

  • System/Process Information Access
  • Global Host Information Access
  • Global Service Information Access

– Reload Nagios

References:
http://nagios.sourceforge.net/docs/3_0/cgiauth.html
http://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-another-user-for-nagios-web-interface-607353/
http://linuxsysadminblog.com/2009/05/setup-nagios-user-to-view-specific-host-and-services/

Loved this article? Send Ethereum to this address: 0x9b09d5b83395FE4F43e4746a8c44E8d8491799A3

Add an user access to Nagios web interface

One thought on “Add an user access to Nagios web interface

Leave a comment