[icinga-users] Icinga-web on CentOS 7 with repos

Michael Friedrich michael.friedrich at netways.de
Wed Aug 20 10:42:53 CEST 2014

Am 19.08.2014 23:14, schrieb Sven Duscha:

I am trying to install Icinga2 with icinga-web on an otherwise fresh CentOS 7 installation. I am using the repository published on the icinga homepage:

name=ICINGA (stable release for epel)

I installed the most recent icinga2 packages version 2.0.2:

Aug 19 17:49:35 Installed: icinga2-2.0.2-1.el7.centos.x86_64
Aug 19 17:49:35 Installed: icinga2-ido-pgsql-2.0.2-1.el7.centos.x86_64
Aug 19 17:49:35 Installed: icinga2-doc-2.0.2-1.el7.centos.x86_64
Aug 19 17:49:43 Installed: icinga-web-1.11.2-1.el7.centos.noarch
Aug 19 17:49:51 Installed: icinga2-debuginfo-2.0.2-1.el7.centos.x86_64
Aug 19 17:53:45 Erased: icinga2-ido-pgsql-2.0.2-1.el7.centos.x86_64
Aug 19 17:54:36 Installed: icinga2-ido-mysql-2.0.2-1.el7.centos.x86_64
Aug 19 18:16:22 Installed: icinga-web-mysql-1.11.2-1.el7.centos.noarch
Aug 19 18:17:22 Installed: 1:mariadb-5.5.37-1.el7_0.x86_64
Aug 19 18:17:26 Installed: 1:mariadb-server-5.5.37-1.el7_0.x86_64
Aug 19 18:18:53 Installed: icinga-web-mysql-1.11.2-1.el7.centos.noarch
Aug 19 18:29:07 Installed: icinga2-ido-mysql-2.0.2-1.el7.centos.x86_64
Aug 19 16:48:46 Installed: php-mysql-5.4.16-23.el7_0.x86_64

Unfortunately when trying to access the page: http://ip/icinga-web, I encounter an error about

Uncaught Doctrine_Connection_Exception thrown:
Couldn't locate driver named mysql

Are you sure that your php setup properly loads and find the php mysql driver? Verify that by calling a simple script with phpinfo().

the detailed traceback is:

#0 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect()
#1 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Connection.php(1009): Doctrine_Connection_Mysql->connect()
#2 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(976): Doctrine_Connection->execute('SELECT n.sessio...', Array)
#3 /usr/share/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(1026): Doctrine_Query_Abstract->_execute(Array)
#4 /usr/share/icinga-web/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php(133): Doctrine_Query_Abstract->execute()
#5 [internal function]: AppKitDoctrineSessionStorage->sessionRead('7pd2sm5jobg2m6c...')
#6 /usr/share/icinga-web/lib/agavi/src/storage/AgaviSessionStorage.class.php(132): session_start()
#7 /var/cache/icinga-web/config/factories.xml_production_web_3b046d81eca933d9f16b3365d9ddd13114979325.php(76): AgaviSessionStorage->startup()
#8 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(384): include('/var/cache/icin...')
#9 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(3549): AgaviContext->initialize()
#10 /var/cache/icinga-web/config/compile.xml_production__d41bc4e7416d79a2859fb497054ab4f5308e2df1.php(370): AppKitAgaviContext->initialize()
#11 /usr/share/icinga-web/pub/index.php(49): AgaviContext::getInstance('web')
#12 {main}

I also installed for the sake of it the Zend-Adapter, since that popped up on my search for Mysql and Php:
ZendFramework-Db-Adapter-Pdo-Mysql php-ZendFramework-Db-Adapter-Mysqli

Nope. Icinga Web 1.x only requires php-mysql which is pulled by the icinga-web-mysql package.

### MySQL
       # mysql -u root -p

              CREATE USER `icinga_webweb`@`localhost` IDENTIFIED BY 'icinga_webweb';
              CREATE DATABASE `icinga_web`;
              GRANT ALL PRIVILEGES ON `icinga_web`.* TO `icinga_web`@`localhost`;
              FLUSH PRIVILEGES;

       # mysql -u root -p icinga_web < etc/schema/mysql.sql

Using a custom db pass/username requires a config xml update for icinga web.

My apache log shows the following error:

[Tue Aug 19 22:52:11.279566 2014] [:error] [pid 11245] [client] PHP Warning:  Creating default object from empty value in /usr/share/icinga-web/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php on line 174
[Tue Aug 19 22:52:11.279627 2014] [:error] [pid 11245] [client] PHP Fatal error:  Call to undefined method stdClass::save() in /usr/share/icinga-web/app/modules/AppKit/lib/storage/AppKitDoctrineSessionStorage.class.php on line 177

That's a well known Doctrine application bug happening on certain distributions, but there is no simple fix for it. It shouldn't harm the normal operation as it happens after the database specific queries.

But the error in the php doesn't tell me much.

Does anyone know what's going on?

Obviously your rdbms storage driver is missing, maybe it's due to php-mysql -> mariadb client libs change introduced with el7.

kind regards,

Michael Friedrich, DI (FH)
Application Developer

NETWAYS GmbH | Deutschherrnstr. 15-19 | D-90429 Nuernberg
Tel: +49 911 92885-0 | Fax: +49 911 92885-77
GF: Julian Hein, Bernd Erk | AG Nuernberg HRB18461
http://www.netways.de | Michael.Friedrich at netways.de

** Open Source Backup Conference 2014 - September - osbconf.org **
** Puppet Camp Duesseldorf 2014 - Oktober - netways.de/puppetcamp **
** OSMC 2014 - November - netways.de/osmc **
** OpenNebula Conf 2014 - Dezember - opennebulaconf.com **
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.icinga.org/pipermail/icinga-users/attachments/20140820/f7a8dc6d/attachment.html>

More information about the icinga-users mailing list