所有的安装配置里面,都说将cgi.cfg的use_authentication=0,据说这样能够访问全部的页面。事实上,这是一个偷懒的做法,而且在以后必将会更正。
我们会在web页面对一些设置进行更改,在nagios的机制中,都会通过nagios.cmd。而use_authentication=0,会disable external_command_file的使用,于是,所有更改都会提示authentication错误。
正确的做法,首先,将cgi.cfg的use_authentication=1,然后我们授权用户的权限。
authorized_for_system_information=*
authorized_for_configuration_information=*
authorized_for_system_commands=siemsen
authorized_for_all_services=*
authorized_for_all_hosts=*
authorized_for_all_service_commands=*
authorized_for_all_host_commands=*
*代表所有用户,也可以用逗号形式将用户逐一添入(推荐这种方法)。例如:
authorized_for_system_information=nagios,nagiosadmin,www-data,apacheuser
接着,要改变nagios.cmd所在目录/usr/local/nagios/var/rw的权限,命令如下。
chown nagios.nagiocmd /usr/local/nagios/var/rw
chmod u+rwx /usr/local/nagios/var/rw
chmod g+rwx /usr/local/nagios/var/rw
chmod g+s /usr/local/nagios/var/rw
最后重起nagios:
/etc/init.d/nagios restart
再去更新设置,就能成功了!
Trackback: http://tb.donews.net/TrackBack.aspx?PostId=1226523