[Nagios] Configuration Method for Operating from Web Management Interface

Tadashi Shigeoka ·  Wed, May 28, 2014

Here’s how to configure Nagios to operate from the web management interface.

Nagios | ナギオス

Error Message

Sorry Dave, I can't let you do that...

It seems that you have chosen to not use the authentication functionality of the CGIs.

I don’t want to be personally responsible for what may happen as a result of allowing unauthorized users to issue commands to Nagios,so you’ll have to disable this safeguard if you are really stubborn and want to invite trouble.

Read the section on CGI authentication in the HTML documentation to learn how you can enable authentication and why you should want to.

The causes are the following two points:

  • The nginx user running the Nagios web management interface process was not added to the nagios group
  • The nagios group was not authorized to execute commands for nagios configuration changes

Add the nginx user to the nagios group:

usermod -G nagios nginx

Then, enable use_authentication and change the configuration so that only users in the nagios group can execute commands:

# diff cgi.cfg cgi.cfg.2014-05-28 
78c78
< use_authentication=1
---
> use_authentication=0
107c107
< default_user_name=nagios
---
> #default_user_name=guest
119c119
< authorized_for_system_information=nagios
---
> authorized_for_system_information=nagiosadmin
131c131
< authorized_for_configuration_information=nagios
---
> authorized_for_configuration_information=nagiosadmin
144c144
< authorized_for_system_commands=nagios
---
> authorized_for_system_commands=nagiosadmin
157,158c157,158
< authorized_for_all_services=nagios
< authorized_for_all_hosts=nagios
---
> authorized_for_all_services=nagiosadmin
> authorized_for_all_hosts=nagiosadmin
171,172c171,172
< authorized_for_all_service_commands=nagios
< authorized_for_all_host_commands=nagios
---
> authorized_for_all_service_commands=nagiosadmin
> authorized_for_all_host_commands=nagiosadmin

That’s all from the Gemba.

Reference Information