Setting up http://server.examepl.com/icingaweb2/setup

I attempt to setup icinga first time and frankly am a bit confused about all the databases (3?) that need to be setup. I did not find anything about the databases and database requirements in the documentation and altough know sql databases inside out this message is not very informative:

The database you’ve configured to use for Icinga Web seems to be the one of Icinga 2 / Icinga DB. Please be aware that this database configuration is supposed to be used for Icinga Web’s configuration and that it is highly recommended to not mix different schemas in the same database. If this is intentional, you can skip the validation and ignore this warning. If not, please provide a different database.

Are there more than one database required? Should I set these up myself? Is this documented someplace?

you should create databases for each components you use.

this message means that you didn’t.
You are trying to use the same database for the icingaweb2 installation as for another component (icinga2, icingadb)

  • You can have an Icinga2 without icingadb but this is deprecated
  • You can have an Icinga2 without IcingaWeb2
  • You can have an IcingaWeb2 without Icinga2

It works, i don’t say it always makes sense.

but the most important thing is:

If there is any database to fill out, you should create one like it says in the docs. somethimes there are encoding requirements.

Hi! You need mysql or postgresql.
You need databases for icingadb, icingaweb2, the director and some othher modules if you want them.

for example, see here: Debian - Icinga Web

So again I was looking at some out of date documentation: Get started with Icinga

So I created these:

CREATE DATABASE icingaweb2;
CREATE USER 'icingaweb2'@'localhost' IDENTIFIED BY 'XWzHVZcidiR#&jn4qcR9ZMVQa5Jo9';
GRANT ALL PRIVILEGES ON icingaweb2.* TO 'icingaweb2'@'localhost';


CREATE DATABASE director CHARACTER SET 'utf8';
CREATE USER director@localhost IDENTIFIED BY '3S&Vyz2Vv@Zaog7Jdanc@MMPuh~9z';
GRANT ALL ON director.* TO director@localhost;


CREATE DATABASE icingadb;
CREATE USER 'icingadb'@'localhost' IDENTIFIED BY 'owUtV&3LCiHPc&7Au4FUNJQoPd~Uq';
GRANT ALL ON icingadb.* TO 'icingadb'@'localhost';

EXIT;

But setup did not like these and claims:

  • It seems that either the database you defined earlier does not yet exist and cannot be created using the provided access credentials, the database does not have the required schema to be operated by Icinga Web 2 or the provided access credentials do not have the sufficient permissions to access the database. Please provide appropriate access credentials to solve this.

I copied and paste the credentials. Is setup attempting to connect username with or without hostname

Oh have you imported the database scheme for icingadb?

What linux are you using


OS: Debian GNU/Linux 13 (trixie) aarch64
Host: Raspberry Pi 5 Model B Rev 1.0
Kernel: Linux 6.18.29+rpt-rpi-2712
Uptime: 15 mins
Packages: 844 (dpkg)
Shell: bash 5.2.37
Terminal: /dev/pts/1
CPU: BCM2712 (4) @ 2.40 GHz
GPU: Broadcom bcm2712-vc6 [Integrated]
Memory: 428.94 MiB / 3.95 GiB (11%)
Swap: 0 B / 2.00 GiB (0%)
Disk (/): 5.69 GiB / 234.32 GiB (2%) - ext4
Local IP (end0): 192.168.111.22/26
Locale: en_GB.UTF-8

I just follow the steps http://server.example.com/icinga2web/setup

Those steps seem flawed.

There are too many not documented and not explained steps.

My first impression of icinga2 is less than rosy.

General configuration has been successfully written to: /etc/icingaweb2/config.ini

Authentication configuration has been successfully written to: /etc/icingaweb2/authentication.ini
Account "johannes" has been successfully defined as initial administrator.

User Group Backend configuration has been successfully written to: /etc/icingaweb2/groups.ini
Unable to create user group "Administrators". An error occured:
ERROR: Zend_Db_Statement_Exception in /usr/share/icinga-php/ipl/vendor/icinga/zf1/library/Zend/Db/Statement/Pdo.php:235 with message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'icingadb.icingaweb_group' doesn't exist, query was: SELECT COUNT(*) AS cnt FROM icingaweb_group AS g WHERE (g.name = 'Administrators')

Resource configuration has been successfully written to: /etc/icingaweb2/resources.ini

Resource configuration update successful: /etc/icingaweb2/resources.ini

Module configuration update successful: /etc/icingaweb2/modules/icingab/config.ini

Commandtransport configuration update successful: /etc/icingaweb2/modules/icingadb/commandtransports.ini

Monitoring backend configuration has been successfully written to: /etc/icingaweb2/modules/monitoring/backends.ini
Resource configuration has been successfully updated: /etc/icingaweb2/resources.ini

Command transport configuration has been successfully created: /etc/icingaweb2/modules/monitoring/commandtransports.ini

Monitoring security configuration has been successfully created: /etc/icingaweb2/modules/monitoring/config.ini

Module "doc" has been successfully enabled.
Module "icingadb" has been successfully enabled.
Module "migrate" has been successfully enabled.
Module "monitoring" has been successfully enabled.

Frankly I’m just following the documented steps Quickstart - Get started with Icinga

Those steps are incomplete

grep icingaweb /usr/share/icingadb/schema/mysql/schema.sql

finds no table icingaweb_group

could someone go over the getting started? there is a step missing:

mysql -u root -p icingaweb2 < /usr/share/icingaweb2/schema/mysql.schema.sql

and:

CREATE DATABASE ido CHARACTER SET 'utf8';
CREATE USER ido@localhost IDENTIFIED BY 'blub';
GRANT ALL ON ido.* TO ido@localhost;

Followed by

mysql -u root -p ido < /usr/share/icinga2-ido-mysql/schema/mysql.sql$

Also right at the beginning

apt-get install icinga2-ido-mysql

Actually, the ido is deprecated, so those steps are not needed anymore. Use icingadb instead.

sadly, I dont have time right now to go step by step through that quick start

Got that now, yeah. So I decided to start afresh removed all the databases and enabled setup.

Got pretty far but sadly now see: Cannot load resource config “director”. Resource does not exist

#0 /usr/share/icingaweb2/modules/director/library/Director/Db.php(59): Icinga\Data\ResourceFactory::getResourceConfig()
#1 /usr/share/icingaweb2/modules/director/library/Director/Web/Controller/Extension/DirectorDb.php(147): Icinga\Module\Director\Db::fromResourceName()
#2 /usr/share/icingaweb2/modules/director/application/controllers/IndexController.php(19): Icinga\Module\Director\Web\Controller\ActionController->db()
#3 /usr/share/icinga-php/ipl/vendor/icinga/zf1/library/Zend/Controller/Action.php(528): Icinga\Module\Director\Controllers\IndexController->indexAction()
#4 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(78): Zend_Controller_Action->dispatch()
#5 /usr/share/icinga-php/ipl/vendor/icinga/zf1/library/Zend/Controller/Front.php(954): Icinga\Web\Controller\Dispatcher->dispatch()
#6 /usr/share/php/Icinga/Application/Web.php(296): Zend_Controller_Front->dispatch()
#7 /usr/share/php/Icinga/Application/webrouter.php(107): Icinga\Application\Web->dispatch()
#8 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#9 {main}

Hi !

I can provide a more exemplified install guide on installing icinga2+icingadb+icingadb-web+director

As this doesn’t write itself i would ask for some patience.

I think i can provide this today ..

please stand by.

Regards

David

I’ve fullfilled my promise here is a more in depth guide.

Regards

David