Cant view Command in Director

Environment:
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.2-1)

Copyright (c) 2012-2022 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Ubuntu
Platform version: 20.04.4 LTS (Focal Fossa)
Kernel: Linux
Kernel version: 5.4.0-96-generic
Architecture: x86_64

Build information:
Compiler: GNU 9.3.0
Build host: runner-hh8q3bz2-project-298-concurrent-0
OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020

icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite influxdb influxdb2 opentsdb perfdata statusdata syslog
Enabled features: api checker command icingadb ido-mysql livestatus mainlog notification

icinga2 daemon -C
[2022-03-15 19:06:14 +0000] information/cli: Icinga application loader (version: r2.13.2-1)
[2022-03-15 19:06:14 +0000] information/cli: Loading configuration file(s).
[2022-03-15 19:06:14 +0000] information/ConfigItem: Committing config item(s).
[2022-03-15 19:06:14 +0000] information/ApiListener: My API identity: icinga02.int.smarthouse.de
[2022-03-15 19:06:14 +0000] warning/ApplyRule: Apply rule ‘’ (in /var/lib/icinga2/api/packages/director/50a388b7-c910-492b-90ae-03df2852ccc4/zones.d/director-global/service_apply.conf: 1:0-1:15) for type ‘Service’ does not match anywhere!
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 IcingaApplication.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 3 Hosts.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 FileLogger.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 IcingaDB.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 CheckerComponent.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 ApiListener.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 5 Zones.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 3 Endpoints.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 ApiUser.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 246 CheckCommands.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 LivestatusListener.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 1 NotificationComponent.
[2022-03-15 19:06:14 +0000] information/ConfigItem: Instantiated 34 Services.
[2022-03-15 19:06:14 +0000] information/ScriptGlobal: Dumping variables to file ‘/var/cache/icinga2/icinga2.vars’
[2022-03-15 19:06:14 +0000] information/cli: Finished validating the configuration file(s).

Icinga Web 2 Version
2.9.6
Git commit
e702d933e15b0907628091a03741baff1b6074df
PHP Version
7.4.3

Git commit date
2022-03-08
Copyright
© 2013-2022 Icinga GmbH

1 Like

I have created a command from check_snmp.
I used it in a service template and a host to test custom fields von OID & Community String.
In the Host i use something simular to “write back” (?).

After that i go back to the command and see:

Uncaught Error: Object of class stdClass could not be converted to string in /usr/share/icingaweb2/modules/director/library/Director/Web/Form/Element/Text.php:14
Stack trace:
#0 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/IcingaObjectFieldLoader.php(404): Icinga\Module\Director\Web\Form\Element\Text->setValue()
#1 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/IcingaObjectFieldLoader.php(184): Icinga\Module\Director\Web\Form\IcingaObjectFieldLoader->setValuesFromObject()
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/IcingaObjectFieldLoader.php(200): Icinga\Module\Director\Web\Form\IcingaObjectFieldLoader->getElements()
#3 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(458): Icinga\Module\Director\Web\Form\IcingaObjectFieldLoader->prepareElements()
#4 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(818): Icinga\Module\Director\Web\Form\DirectorObjectForm->prepareFields()

How can i delete these command?

We build another Command that work as expected.
But we cant change it anymore.

Both commands are now not editable

Same thing happens in my test environment hosted on Ubuntu 22.04 with Icinga2 r2.13.4-1 and Icinga Web 2 Version 2.11.1

Edit: The error apparently only happens when using fields to hand over parameters. Using Arguements works fine.

this issue is not related to icinga2 or icingaweb2.

It’s caused by icinga director, so it would be important to know the icinga director version.

Hi, my director is Version 1.9.1

Please describe how to produce this issue in detail.

Hi,

sorry for my rather late reply.
This seems to happen after cloning a command from conf.d and then adding field options. The command in question is from this check plugin.
It becomes unusable right after adding field options, yet the original works fine.