Problem creating host template with director

Hello,

I installed Icinga2 and the director, created a timetable and wanted to set up an agent/host template.

But I get following error when I enter “hostname” as check command:
It looks like following situation, but I recreated the API user and nothing changed.

The API user has all access rights.

I appreciate for any help.

#0 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(1173): Icinga\Module\Director\Data\Db\DbObject->loadFromDb()
#1 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(535): Icinga\Module\Director\Data\Db\DbObject::load(String, Object(Icinga\Module\Director\Db))
#2 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(618): Icinga\Module\Director\Objects\IcingaObject->resolveUnresolvedRelatedProperty(String)
#3 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(667): Icinga\Module\Director\Objects\IcingaObject->getRelationId(String)
#4 /usr/share/icingaweb2/modules/director/library/Director/Data/Db/DbObject.php(444): Icinga\Module\Director\Objects\IcingaObject->get(String)
#5 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(1315): Icinga\Module\Director\Data\Db\DbObject->getProperties()
#6 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(1064): Icinga\Module\Director\Objects\IcingaObject->resolve(String)
#7 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(1166): Icinga\Module\Director\Objects\IcingaObject->resolveProperties()
#8 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(1049): Icinga\Module\Director\Objects\IcingaObject->getResolved(String)
#9 /usr/share/icingaweb2/modules/director/library/Director/Objects/IcingaObject.php(979): Icinga\Module\Director\Objects\IcingaObject->getResolvedProperties()
#10 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(1006): Icinga\Module\Director\Objects\IcingaObject->getResolvedProperty(String)
#11 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/DirectorObjectForm.php(969): Icinga\Module\Director\Web\Form\DirectorObjectForm->getSentOrObjectValue(String, NULL, Boolean)
#12 /usr/share/icingaweb2/modules/director/application/forms/IcingaHostForm.php(84): Icinga\Module\Director\Web\Form\DirectorObjectForm->getSentOrResolvedObjectValue(String)
#13 /usr/share/icingaweb2/modules/director/application/forms/IcingaHostForm.php(66): Icinga\Module\Director\Forms\IcingaHostForm->addClusteringElements()
#14 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(365): Icinga\Module\Director\Forms\IcingaHostForm->setup()
#15 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(582): Icinga\Module\Director\Web\Form\QuickForm->prepareElements()
#16 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(597): Icinga\Module\Director\Web\Form\QuickForm->setRequest(Object(Icinga\Web\Request))
#17 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(376): Icinga\Module\Director\Web\Form\QuickForm->getRequest()
#18 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/ObjectController.php(123): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
#19 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Director\Web\Controller\ObjectController->addAction()
#20 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#21 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#22 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#23 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#24 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#25 {main}

Hi,

hostname is not a check command.
Please show screenshots of the Director config or post the config from the Directors preview screen.
Also tell what versions are used.

You are right, I meant hostalive…, sorry for that.
It is Icinga Web 2.7.3
And I think I have found an error, because version for the director is master and I think this is wrong.
Loaded version 1.7 but still see master as version information.
Do you need anything else?

Try deleting the director from the modules folder with rm -fR /usr/share/icingaweb2/modules/director
and then download it again like shown in the docs

ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
REPO_URL="https://github.com/icinga/icingaweb2-module-director"
TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"
MODULE_VERSION="1.7.2"
git clone "${REPO_URL}" "${TARGET_DIR}" --branch v${MODULE_VERSION}
cd "${TARGET_DIR}" && git checkout "v${MODULE_VERSION}"

be sure to have all prerequisites installed: https://github.com/Icinga/icingaweb2-module-director/blob/master/doc/02-Installation.md#requirements

To then have the “internal” check commands (https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/) loaded into the director you need to run the kickstart wizard. You can does that by going into the webinterface -> Director -> Icinga Infrastructure -> Kickstart wizard. Put the endpoint name (see the /etc/icinga2/zones.conf file for the exact name) and the API user (see /etc/icinga2/conf.d/api-user.conf) into the form an run the import.
That should be all and then you can work with the check commands.