Cannot send external command

Hi

I can not send “external commands” from my icingaweb interface:
icinga2: Can’t send external Icinga command: 500 Action execution failed: 'Error: Could not create comment.

for example comment, downtime.

 cat /etc/icingaweb2/modules/monitoring/commandtransports.ini
[icinga2]
transport = "api"
host = "api.blabla" ; Icinga 2 host
port = "5665"
username = "icingaweb2"
password = "XXXXXX";
cat /etc/icinga2/features-available/api.conf 
object ApiListener "api" {
  accept_config = true
  accept_commands = true
  ticket_salt = TicketSalt

  bind_host = "*"
  bind_port = 5665
}

object ApiUser "icingaweb2" {
  password = "XXXXXXX"

  permissions = [
    {
      permission = "*"
    }
  ]
}
icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite influxdb livestatus opentsdb statusdata syslog
Enabled features: api checker command ido-pgsql mainlog notification perfdata
icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.11.2-1)

Do you have any ideas?
Thanks
Alex

Hi,

do you see anything in the icinga2 log files?

tail -f /var/log/user.log
icingaweb2[4357]: Icinga\Module\Monitoring\Exception\CommandTransportException in /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php:137 with message: icinga2: Can't send external Icinga command: 500 Action execution failed: 'Error: Could not create downtime object.    '.    #0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php(192): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand))    #1 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php(221): Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm->scheduleDowntime(Object(Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand), Object(Icinga\Web\Request))    #2 /usr/share/php/Icinga/Web/Form.php(1171): Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm->onSuccess()    #3 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(133): Icinga\Web\Form->handleRequest()    #4 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(121): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->handleCommandForm(Object(Icinga\Module\Monitoring\Forms\Command\Object\ScheduleServiceDowntimeCommandForm))    #5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ServiceController->scheduleDowntimeAction()    #6 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)    #7 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))    #8 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))    #9 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()    #10 /usr/share/icingaweb2/public/index.php(4): require_once(String)    #11 {main}
 icingaweb2[4357]: Icinga\Module\Monitoring\Exception\CommandTransportException in /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/ApiCommandTransport.php:234 with message: Can't send external Icinga command: 500 Action execution failed: 'Error: Could not create comment.    '.
icingaweb2[4357]: Icinga\Module\Monitoring\Exception\CommandTransportException in /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php:137 with message: icinga2: Can't send external Icinga command: 500 Action execution failed: 'Error: Could not create comment.    '.    #0 /usr/share/icingaweb2/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php(163): Icinga\Module\Monitoring\Command\Transport\CommandTransport->send(Object(Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand))    #1 /usr/share/php/Icinga/Web/Form.php(1171): Icinga\Module\Monitoring\Forms\Command\Object\AcknowledgeProblemCommandForm->onSuccess()    #2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/Web/Controller/MonitoredObjectController.php(133): Icinga\Web\Form->handleRequest()    #3 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(85): Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController->handleCommandForm(Object(Icinga\Module\Monitoring\Forms\Command\Object\AcknowledgeProblemCommandForm))    #4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Monitoring\Controllers\ServiceController->acknowledgeProblemAction()    #5 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)    #6 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))    #7 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))    #8 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()    #9 /usr/share/icingaweb2/public/index.php(4): require_once(String)    #10 {main}

on icinga.log

[2020-02-13 18:01:20 +0100] information/Checkable: Notifications are disabled for checkable 'hostblabla!oco-service'.
[2020-02-13 18:01:24 +0100] information/ApiListener: New client connection from [10.108.17.180]:21820 (no client certificate)
[2020-02-13 18:01:24 +0100] information/HttpServerConnection: Request: POST /v1/actions/add-comment (from [10.108.17.180]:21820), user: icingaweb2, agent: ).
[2020-02-13 18:01:24 +0100] information/HttpServerConnection: HTTP client disconnected (from [10.108.17.180]:21820)

humm i put debug and


[2020-02-13 18:08:06 +0100] notice/ConfigObject: Ignoring config object 'XXXXXXXXXXXXXX' of type 'Comment' due to errors: Error: Validation failed for object 'XXXXXXXXX!oco-service!XXXXXXXX' of type 'Comment'; Attribute 'author': Attribute must not be empty.

but i cannot see where i can put author…

Ok, that makes sense. The error in the previous comment says that it’s missing some string value for a parameter. The debug log says it’s the author that’s missing.

I’m not a frontend expert but something seems to be strange with your session. So, stupid question but does logging out and log back in again change anything?