Icinga Director Cannot load resource config "director". Resource does not exist

Hi All,

I’m new to Icinga, and Director. I’ve followed the install guides for Ubuntu and I’ve met with trouble in getting Director up and running. The module is installed, and I can access it from the Icinga2Web UI, however I’m not able to select the “director” database that was created as part of the setup steps. The only databases that were available for selection were the icinga2 and icingaweb databases.

I’ve manually edited the director config file to tell it to use the director database, but when trying to use Director I get the following stack trace on the webui:

Cannot load resource config "director". Resource does not exist
#0 /usr/share/icingaweb2/modules/director/application/forms/KickstartForm.php(450): Icinga\Data\ResourceFactory::getResourceConfig()
#1 /usr/share/icingaweb2/modules/director/application/forms/KickstartForm.php(50): Icinga\Module\Director\Forms\KickstartForm->tryDbConnection()
#2 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(371): Icinga\Module\Director\Forms\KickstartForm->setup()
#3 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(588): Icinga\Module\Director\Web\Form\QuickForm->prepareElements()
#4 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(603): Icinga\Module\Director\Web\Form\QuickForm->setRequest()
#5 /usr/share/icingaweb2/modules/director/library/Director/Web/Form/QuickForm.php(382): Icinga\Module\Director\Web\Form\QuickForm->getRequest()
#6 /usr/share/icingaweb2/modules/director/application/controllers/SettingsController.php(25): Icinga\Module\Director\Web\Form\QuickForm->handleRequest()
#7 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Action.php(516): Icinga\Module\Director\Controllers\SettingsController->indexAction()
#8 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch()
#9 /usr/share/icinga-php/vendor/vendor/shardj/zf1-future/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch()
#10 /usr/share/php/Icinga/Application/Web.php(294): Zend_Controller_Front->dispatch()
#11 /usr/share/php/Icinga/Application/webrouter.php(105): Icinga\Application\Web->dispatch()
#12 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#13 {main}

The director config file:

[db]
resource = "director"

my api-users.conf:

/**
* The ApiUser objects are used for authentication against the API.
*/
object ApiUser "root" {
 password = "password"
 // client_cn = ""

 permissions = [ "*" ]
}

object ApiUser "director" {
       password = "password"
       permissions = [ "*" ]
}

and my Zones file:

/*
 * Endpoint and Zone configuration for a cluster setup
 * This local example requires `NodeName` defined in
 * constants.conf.
 */

object Endpoint NodeName {
  host = NodeName
}

object Zone ZoneName {
  endpoints = [ NodeName ]
}

/*
 * Defines a global zone for distributed setups with masters,
 * satellites and clients.
 * This is required to sync configuration commands,
 * templates, apply rules, etc. to satellite and clients.
 * All nodes require the same configuration and must
 * have `accept_config` enabled in the `api` feature.
 */

object Zone "global-templates" {
  global = true
}

/*
 * Defines a global zone for the Icinga Director.
 * This is required to sync configuration commands,
 * templates, apply rules, etc. to satellite and clients.
 * All nodes require the same configuration and must
 * have `accept_config` enabled in the `api` feature.
 */

object Zone "director-global" {
  global = true
}

/*
 * Read the documentation on how to configure
 * a cluster setup with multiple zones.
 */

/*
object Endpoint "master.example.org" {
  host = "master.example.org"
}

object Endpoint "satellite.example.org" {
  host = "satellite.example.org"
}

object Zone "master" {
  endpoints = [ "master.example.org" ]
}

object Zone "satellite" {
  parent = "master"
  endpoints = [ "satellite.example.org" ]
}
*/

  • Director version (System - About): 1.11.1
  • Icinga Web 2 version and modules (System - About): 2.12.1
  • Icinga 2 version (icinga2 --version):
  • Operating System and version: Ubuntu 22.04.4 LTS (Jammy Jellyfish)
  • Webserver, PHP versions: Apache/2.4.52 (Ubuntu), 8.1.2-1ubuntu2.17

Like I said, I’m pretty new to this and have probably made a silly mistake somewhere, but I’m not familiar enough to figure it out on my own.

the director resource is missing in this file.

cat /etc/icingaweb2/resources.ini

what’s the content of your resource ini?

[icingaweb_db]
type = "db"
db = "mysql"
host = "localhost"
dbname = "icingaweb2"
username = "icingaweb2"
password = "password"
use_ssl = "0"

[icinga_ido]
type = "db"
db = "mysql"
host = "localhost"
dbname = "icinga2"
username = "icinga2"
password = "password"
use_ssl = "0"

Should there be an entry in there for the director db?

yes. This could look like:

[director_db]
type = "db"
db = "mysql"
host = "localhost"
dbname = "director"
username = "director"
password = "*redacted*"
charset = "utf8"
use_ssl = "0"
1 Like

Thanks, this has worked.