请帮我用icingaweb解决这个问题。
icinga2:无法将外部Icinga命令发送到本地命令文件“/var/run/Icinga 2/cmd/icinga2.cmd”:权限被拒绝。
#0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php(191): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand))
#1 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php(108): Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm->scheduleDowntime(Object(Icinga\Module\Monitoring\Command\Object\ScheduleHostDowntimeCommand), Object(Icinga\Web\Request))
#2 /usr/share/php/Icinga/Web/Form.php(1152): Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm->onSuccess()
#3 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(128): Icinga\Web\Form->handleRequest()
#4 /usr/share/icingaweb2/modules/monitoring/application/controllers/HostController.php(155): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->handleCommandForm(Object(Icinga\Module\Monitoring\Forms\Command\Object\ScheduleHostDowntimeCommandForm))
#5 /usr/share/php/Zend/Controller/Action.php(516): Icinga\Module\Monitoring\Controllers\HostController->scheduleDowntimeAction()
#6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('scheduleDowntim...')
#7 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#8 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#9 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#10 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#11 {main}发布于 2018-08-24 15:01:02
在我的例子(CentOS 7)中,我所要做的就是确保启用icinga2特性‘命令’,并重新启动服务。
icinga2 feature enable command
systemctl restart icinga2.service发布于 2016-12-21 13:40:59
错误消息可能是正确的。您需要为该文件设置正确的unix权限。CentOS7包在那里做了正确的事情,但对我来说,问题与selinux有关。检查SELinux拒绝,看看您的命令是否被拒绝:
ausearch -m avc --start recent检查命令文件的上下文:
# ls -lZ /var/run/icinga2/cmd/icinga2.cmd
prw-rw----. icinga icingacmd system_u:object_r:var_run_t:s0 /var/run/icinga2/cmd/icinga2.cmd我通过安装icinga2-selinux包修复了这个问题,在完成了所有其他配置之后。特别是,在启用本地(命名管道)命令传输后,需要(重新)安装它。重新安装icinga2-selinux之后,正确的上下文应该是:
# ls -lZ /var/run/icinga2/cmd/icinga2.cmd
prw-rw----. icinga icingacmd system_u:object_r:icinga2_command_t:s0 /var/run/icinga2/cmd/icinga2.cmd重新启动icinga2和Apache。
发布于 2017-06-22 01:42:51
禁用selinux会有帮助。临时禁用selinux,然后重试。
setenforce 0 如果有效的话,试试永久的。编辑/etc/selinux/config并确保
SELINUX=disabledhttps://stackoverflow.com/questions/40672951
复制相似问题