Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Steps for configuring Nagvis with IcingaDB and changes to the core.php function in Nagvis #126

Open
adamparker opened this issue Jul 22, 2024 · 1 comment

Comments

@adamparker
Copy link

I had some difficulties with the documentation for installing Nagvis with IcingaDB.

In the step where you add the EmbeddedWeb to the core.php file, it was unable to find the classes for EmbeddedWeb.

icinga2_icingaweb  | [Mon Jul 22 14:25:27.378958 2024] [php7:error] [pid 4846] [client 172.20.0.1:46090] PHP Fatal error:  main(): Failed opening required 'Icinga/Application/EmbeddedWeb.php' (include_path='.:/usr/share/php:../../server/core/classes:../../server/core/classes/objects:../../server/core/ext/php-gettext-1.0.12:../../frontend/nagvis-js/classes/') in /data/usr/local/nagvis/share/server/core/functions/core.php on line 8

I had to add icingaweb2 library to the path to resolve this.

$path = '/usr/share/icingaweb2/library';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

/**
 * Icinga Web 2 integration
 */
use Icinga\Application\EmbeddedWeb;

require_once 'Icinga/Application/EmbeddedWeb.php';
require_once EmbeddedWeb::start('/usr/share/icingaweb2', '/etc/icingaweb2')
    ->getModuleManager()
    ->getModule('nagvis')
    ->getLibDir() . '/nagvis-includes/init.inc.php';

Any suggestions on why this was needed? I am using this inside a docker environment if that helps.

@yhabteab
Copy link
Member

Hi @adamparker, thans for reporting!

Any suggestions on why this was needed? I am using this inside a docker environment if that helps.

Actually, when installing Icinga Web 2 from packages the icingaweb2/library/Icinga is installed into the /usr/share/php/Icinga directory and since /usr/share/php is already set as an include path (include_path='.:/usr/share/php:), this works without any issues. However, our Icinga Web 2 Docker images do not seem to follow this package installation path, which leads to this kind of include path errors for you, so you may want to open an issue there so that it automatically creates a symlink or something in that include path without you having to set the this /usr/share/icingaweb2/library manually.

@yhabteab yhabteab transferred this issue from Icinga/icingaweb2-module-nagvis Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants