Vspheredb plugin creating some strange error

Hi,
I am trying to set vsphere plugin for icinga2 to monitor my host machine, but somehow I have stumbled on Icinga2 documentation.

the whole module is pulled from GIT to “/usr/share/icingaweb2/modules”, then again when I need to point to config.ini to the resources I get different path: "In the module’s config.ini (usually **/etc/icingaweb2/modules/vspheredb/config.ini** ) you need to reference above DB connection: "

now when I go to this directory, there is no vspheredb, as whole module is set on /usr/share/icingaweb2/modules.

If I create file in the /usr/share/icingaweb2/modules/vspheredb/config.ini and paste resource content.
After enabling this module, and when I go to VMware menu, and try to select that new resource I get some strange error saying:

Fatal error: Cannot use Icinga\Data\Db\DbConnection as DbConnection becuase the name is already in use in /usr/share/icingaweb2/modules/vspheredb/vSpheredb/Db/Migrations.php on line 9.

What am I doing wrong?
why the paths are different? Why in the second path I do not have vspheredb module (I mean it is downloaded in /usr/share/icingaweb2/modules), so why then /etc/icingaweb2/modules ?

just to add link for the documentation part:
vsphere - module install

Looking forward for clarification

just to add additional info:
all prerequisites are installed properly

  • php-soap
  • php-process,

etc…
I have checked again for the database input: user, password, db name, collation, etc…, everything is OK,
Also which I noticed that if I don’t create a file config.ini when I enable module, it will allow me to select resource, and when I do and store config, it recreates indeed in /etc/icingaweb2/modules/ new folder called vspheredb and inside config.ini, but again I get that weir error message

** Fatal error: Cannot use Icinga\Data\Db\DbConnection as DbConnection becuase the name is already in use in /usr/share/icingaweb2/modules/vspheredb/vSpheredb/Db/Migrations.php on line 9.**

P.S. I am using php 5.6 version. I seriously do not expect that this will cause any issue as when installing icinga I have read that it requires > 5.4 version, so this should be supported.

OK, found what was the issue. For some reason it did not work with php 5.6 version, but when I installed remi repo and upgraded from php 56 to php 7.1 the error is gone.

So the solution for my problem is to install php version 7.x

Brgds

1 Like