IDO SQLite

Hi all!

When i set up Icingaweb2 (v2.11.2-1), i confused…

Documentation (https://icinga.com/docs/icinga2/latest/) says that IDO database should be MySQL or PostgreSQL. But installation wizard allows to additionally select SQLite.
Documentation has no words about SQLite and google search shows me nothing relevant.

Attempt to use SQLite failed due to errors.

Cannot find the IDO schema. Please verify that the given database contains the schema and that the configured user has access to it.

Due to fails find schema on GitHab i tried to move schema from postgresql. Then Icingaweb2 showed me another error.

There is currently no icinga instance writing to the IDO. Make sure that a icinga instance is configured and able to write to the IDO.

If i skip validation then icingaweb2 crashes:

Undefined index: host
#0 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/BackendStep.php(98): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(Integer, String, String, Integer, Array)
#1 /usr/share/icingaweb2/modules/setup/library/Setup/Setup.php(75): Icinga\Module\Monitoring\BackendStep->getSummary()
#2 /usr/share/icingaweb2/modules/monitoring/library/Monitoring/MonitoringWizard.php(50): Icinga\Module\Setup\Setup->getSummary()
#3 /usr/share/php/Icinga/Web/Wizard.php(271): Icinga\Module\Monitoring\MonitoringWizard->setupPage(Object(Icinga\Module\Setup\Forms\SummaryPage), Object(Icinga\Web\Request))
#4 /usr/share/php/Icinga/Web/Wizard.php(264): Icinga\Web\Wizard->handleRequest(Object(Icinga\Web\Request))
#5 /usr/share/icingaweb2/modules/setup/application/controllers/IndexController.php(46): Icinga\Web\Wizard->handleRequest()
#6 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Setup\Controllers\IndexController->indexAction()
#7 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)
#8 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#9 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#10 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()
#11 /usr/share/icingaweb2/public/index.php(4): require_once(String)
#12 {main}

Additional info:

icinga2 - The Icinga 2 network monitoring daemon (version: 2.11.2-1)

System information:
  Platform: CentOS Linux
  Platform version: 7 (Core)
  Kernel: Linux
  Kernel version: 3.10.0-862.el7.x86_64
  Architecture: x86_64

Is it really possible to use SQLite? How to properly configured it?

Thanks!

Hello,

SQLite is not supported as far as i know. Iicngaweb2 shows it only because php supports it.

Regards,
Carsten

1 Like

Hi!

Thanks for the answer!

Yes, you’re right. I checked icinga2 source code (https://github.com/Icinga/icinga2) and found only MySQL and PostgreSQL functions. Nothing more…

But what for icingaweb2 was programmed to show this options? Look at function: https://github.com/Icinga/icingaweb2/blob/master/application/forms/Config/Resource/DbResourceForm.php#L27

This is not a part of vendors php libraries. Seems like icinga developers intentionally wrote this. Is they planned to add support for MSSQL, DB2, Oracle, SQLite?

BR,
zl61den6

Hi,

Icinga Web is a framework and allows to integrate different data sources. The “core” database support only consists of MySQL and PostgreSQL. You can see that with the IDO database resource from Icinga 2, where the monitoring module retrieves details from. For managing users and settings, Icinga Web itself uses its own DB resources. Still, MySQL/MariaDB and PostgreSQL only.

The framework is built for modules, some of them need to integrate further databases and data providers. Maybe you have heard about the Director which allows you to automatically import and sync host objects, and facts from external (database) resources. This is not only limited to the “core” databases with MySQL, PostgreSQL, etc. but can be extended to everything where PHP PDO adapters are available. Specific additional database resource types have been implemented, like OCI.

That being said, you can for example use the Director to sync monitoring objects from your Oracle database. Or you can write your own module which uses the Icinga Web database resource model and supports SQLite for retrieving data.

In terms of Icinga 2 & Icinga Web 2 as core products in the Icinga stack, there’s no plans to extend the database types. 2 of them are already enough to support which not only covers the main implementation but also performance, troubleshooting, etc. Literally every developer needs to know multiple databases and their specifics these days which really is hard not being a DBA on the day job.

Cheers,
Michael

Hi,

Thank you! It is clear now.

BR,
zl61den6