首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >icingaweb2权限被拒绝

icingaweb2权限被拒绝
EN

Stack Overflow用户
提问于 2016-11-18 09:00:40
回答 3查看 5.2K关注 0票数 4

请帮我用icingaweb解决这个问题。

icinga2:无法将外部Icinga命令发送到本地命令文件“/var/run/Icinga 2/cmd/icinga2.cmd”:权限被拒绝。

代码语言:javascript
复制
#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}
EN

回答 3

Stack Overflow用户

发布于 2018-08-24 15:01:02

在我的例子(CentOS 7)中,我所要做的就是确保启用icinga2特性‘命令’,并重新启动服务。

代码语言:javascript
复制
icinga2 feature enable command
systemctl restart icinga2.service
票数 3
EN

Stack Overflow用户

发布于 2016-12-21 13:40:59

错误消息可能是正确的。您需要为该文件设置正确的unix权限。CentOS7包在那里做了正确的事情,但对我来说,问题与selinux有关。检查SELinux拒绝,看看您的命令是否被拒绝:

代码语言:javascript
复制
ausearch -m avc --start recent

检查命令文件的上下文:

代码语言:javascript
复制
# 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之后,正确的上下文应该是:

代码语言:javascript
复制
# 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。

票数 1
EN

Stack Overflow用户

发布于 2017-06-22 01:42:51

禁用selinux会有帮助。临时禁用selinux,然后重试。

代码语言:javascript
复制
setenforce 0 

如果有效的话,试试永久的。编辑/etc/selinux/config并确保

代码语言:javascript
复制
SELINUX=disabled
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40672951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档