icinga2: Can't send external Icinga command to the local command file "/var/run/icinga2/cmd/icinga2.cmd": Permission denied.

This forum was archived to /woltlab and is now in read-only mode.
  • Icinga Master Server Http error, when i click the services and check now it shows the following error.

    icinga2: Can't send external Icinga command to the local command file "/var/run/icinga2/cmd/icinga2.cmd": Permission denied.

    0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php(70): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand))#1 /usr/share/php/Icinga/Web/Form.php(1152): Icinga\Module\Monitoring\Forms\Command\Object\CheckNowCommandForm->onSuccess()#2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(63): Icinga\Web\Form->handleRequest()#3 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(64): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->showAction()#4 /usr/share/php/Zend/Controller/Action.php(516): Icinga\Module\Monitoring\Controllers\ServiceController->showAction()#5 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('showAction')#6 /usr/share/php/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))#7 /usr/share/php/Icinga/Application/Web.php(384): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))#8 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()#9 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')#10 {main}Actually i have tried adding hosts from the hosts.conf file in conf.d directory. Before editing the file i took a backup and edited then when i restarted the services is not started and showing the following error:Job for icinga2.service failed because the control process exited with error code. See "systemctl status icinga2.service" and "journalctl -xe" for details.Then i revert back the host.conf file backup to the same location and restarted it worked. but the above error raised. Thanks

  • That's nothing which fits under the section "important notes". Moved.


    Please ensure to add more details when asking.

    • Icinga 2 and Icinga Web 2 versions (icinga2 --version, Icinga Web 2 -> About)
    • OS/Distribution
    • Permissions on the mentioned directory/path
  • Hi


    Icinga 2 (version: v2.4.10) , Icingaweb2 : V -2.3.4
    Application information:
    Installation root: /usr
    Sysconf directory: /etc
    Run directory: /run
    Local state directory: /var
    Package data directory: /usr/share/icinga2
    State path: /var/lib/icinga2/icinga2.state
    Modified attributes path: /var/lib/icinga2/modified-attributes.conf
    Objects path: /var/cache/icinga2/icinga2.debug
    Vars path: /var/cache/icinga2/icinga2.vars
    PID path: /run/icinga2/icinga2.pid


    System information:
    Platform: CentOS Linux
    Platform version: 7 (Core)
    Kernel: Linux
    Kernel version: 3.10.0-327.28.2.el7.x86_64
    Architecture: x86_64


    ---
    This problem stared when i changed a Satellite node to master node.


    Thanks

  • Hi


    OS/Distribution
    CentOs 7 , 64 Bit


    Icinga 2 daemon (version: v2.4.10) , Icingaweb2 : V -2.3.4


    [root@test-linux ~]# ls -la /etc/icinga2
    total 56
    drwxr-x---. 9 icinga icinga 4096 Aug 10 19:11 .
    drwxr-xr-x. 100 root root 8192 Aug 10 18:27 ..
    drwxr-x---. 2 icinga icinga 4096 Aug 10 18:26 conf.d
    -rw-r--r--. 1 root root 1039 Aug 10 19:11 constants.conf
    -rw-r--r--. 1 root root 1004 Jun 30 11:51 constants.conf.orig
    drwxr-x---. 2 icinga icinga 4096 Aug 10 19:11 features-available
    drwxr-x---. 2 icinga icinga 4096 Aug 10 19:00 features-enabled
    -rw-r-----. 1 icinga icinga 1506 Jun 29 12:32 icinga2.conf
    -rw-r-----. 1 root icinga 164 Jun 29 12:32 init.conf
    drwx------. 2 icinga icinga 4096 Jul 1 10:12 pki
    drwxr-x---. 2 icinga icinga 19 Jun 30 11:37 repository.d
    drwxr-x---. 2 icinga icinga 73 Jun 30 11:37 scripts
    -rw-r--r--. 1 root root 168 Aug 10 19:10 zones.conf
    -rw-r--r--. 1 root root 868 Jun 30 11:51 zones.conf.orig
    drwxr-x---. 2 icinga icinga 19 Jun 30 11:37 zones.d


    [root@test-linux ~]# ls -la /etc/icingaweb2/
    total 36
    drwxrws---. 4 root icingaweb2 4096 Aug 10 16:14 .
    drwxr-xr-x. 100 root root 8192 Aug 10 18:27 ..
    -rw-rw----. 1 apache icingaweb2 54 Aug 10 16:14 authentication.ini
    -rw-rw----. 1 apache icingaweb2 156 Aug 10 16:14 config.ini
    drwxr-s---. 2 apache icingaweb2 41 Aug 10 16:14 enabledModules
    -rw-rw----. 1 apache icingaweb2 54 Aug 10 16:14 groups.ini
    drwxrws---. 5 root icingaweb2 53 Aug 10 16:14 modules
    -rw-rw----. 1 apache icingaweb2 337 Aug 10 16:14 resources.ini
    -rw-rw----. 1 apache icingaweb2 80 Aug 10 16:14 roles.ini



    [root@test-linux ~]# ls -la /usr/share/icinga2
    total 8
    drwxr-xr-x. 3 root root 20 Jun 29 12:32 .
    drwxr-xr-x. 105 root root 4096 Aug 10 14:05 ..
    drwxr-x---. 3 icinga icinga 4096 Jun 30 11:37 include


    [root@test-linux ~]# ls -la /var/lib/icinga2/icinga2.state
    -rw-------. 1 icinga icinga 33171 Aug 11 12:56 /var/lib/icinga2/icinga2.state
    [root@test-linux ~]#



    [root@test-linux ~]# ls -la /var/run/icinga2/
    total 4
    drwxr-xr-x. 3 icinga icingacmd 80 Aug 10 19:11 .
    drwxr-xr-x. 30 root root 860 Aug 10 18:27 ..
    drwxr-s---. 2 icinga icingacmd 80 Aug 10 19:11 cmd
    -rw-r--r--. 1 icinga icinga 5 Aug 10 19:11 icinga2.pid


    [root@test-linux ~]# ls -la /var/run/icinga2/cmd/
    total 0
    drwxr-s---. 2 icinga icingacmd 80 Aug 10 19:11 .
    drwxr-xr-x. 3 icinga icingacmd 80 Aug 10 19:11 ..
    prw-rw----. 1 icinga icingacmd 0 Aug 10 18:27 icinga2.cmd
    srw-rw----. 1 icinga icingacmd 0 Aug 10 19:11 livestatus


    [root@test-linux ~]# ls -la /usr/share/icingaweb2/
    total 12
    drwxr-xr-x. 7 root root 75 Aug 10 14:04 .
    drwxr-xr-x. 105 root root 4096 Aug 10 14:05 ..
    drwxr-xr-x. 9 root root 4096 Aug 10 14:04 application
    drwxr-xr-x. 4 root root 4096 Aug 10 14:04 doc
    drwxr-xr-x. 3 root root 19 Aug 10 14:04 library
    drwxr-xr-x. 6 root root 63 Aug 10 14:04 modules


    [root@test-linux ~]# ls -la /usr/share/php
    total 20
    drwxr-xr-x. 6 root root 56 Aug 10 14:03 .
    drwxr-xr-x. 105 root root 4096 Aug 10 14:05 ..
    drwxr-xr-x. 2 root root 60 Aug 10 14:02 gettext
    drwxr-xr-x. 18 root root 4096 Aug 10 14:03 Icinga
    drwxr-xr-x. 5 root root 4096 Aug 10 14:02 tcpdf
    drwxr-xr-x. 60 root root 4096 Aug 10 14:03 Zend


    Thanks

  • Hi


    [root@test-linux ~]# cat /etc/selinux/config | grep SELINUX=
    # SELINUX= can take one of these three values:
    SELINUX=enforcing


    Can i change it to permissive?


    Thanks

  • Either that or you'll just install the "icinga2-selinux" package. That should take care about setting the appropriate policies as well.