2016-11-18 100 views
2

請幫我解決這個問題有icingawebicingaweb2權限被拒絕

icinga2:不能在本地命令文件發送外部Icinga命令「/var/run/icinga2/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} 
+0

請與'須藤LS/var/run中/ icinga2/CMD/icinga2.cmd'如果文件存在 – ice1e0

回答

1

的錯誤信息是可能是正確的。您需要爲該文件設置正確的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。

0

禁用SELinux的幫助。 Temp禁用selinux並重試。

setenforce 0 

如果有效,請嘗試一個永久性的。 編輯/ etc/SELinux的/ config並確保

SELINUX=disabled 
+0

禁用SELinux的臨時調試是好的,但也有是永久禁用整個系統的重要安全功能的許多更好的替代方案。 SELinux可以配置爲允許您需要的任何特定操作。 –