diff --git a/config/icinga.ini b/config/icinga.ini index c685d24d6..871e759f8 100755 --- a/config/icinga.ini +++ b/config/icinga.ini @@ -3,6 +3,7 @@ environment = development timezone = "Europe/Berlin" indexModule = monitoring indexController = dashboard +moduleFolder = "/usr/etc/icinga-modules" [logging] ; General log diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 715850ee5..4675a1e4c 100755 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -100,7 +100,7 @@ abstract class ApplicationBootstrap public function moduleManager() { if ($this->moduleManager === null) { - $this->moduleManager = new ModuleManager($this, "/etc/icinga2/modules_enabled"); + $this->moduleManager = new ModuleManager($this, $this->config->global->moduleFolder); } return $this->moduleManager; } diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index f4612de7f..96a6234c8 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -54,7 +54,7 @@ class Manager public function select() { - $source = new \Icinga\Data\ArrayDataSource($this->getModuleInfo()); + $source = new \Icinga\Data\ArrayDatasource($this->getModuleInfo()); return $source->select(); } @@ -238,7 +238,12 @@ class Manager public function getModuleInfo() { $installed = $this->listInstalledModules(); + $info = array(); + if ($installed === null) { + return $info; + } + foreach ($installed as $name) { $info[] = (object) array( 'name' => $name, @@ -265,7 +270,10 @@ class Manager if ($this->installedBaseDirs === null) { $this->detectInstalledModules(); } - return array_keys($this->installedBaseDirs); + + if ($this->installedBaseDirs !== null) { + return array_keys($this->installedBaseDirs); + } } public function detectInstalledModules() diff --git a/public/js/icinga/container.js b/public/js/icinga/container.js index 8e0891802..4f99ff53e 100755 --- a/public/js/icinga/container.js +++ b/public/js/icinga/container.js @@ -108,6 +108,5 @@ containerMgrInstance = new ContainerMgr($,log,widgets,subTable); } return containerMgrInstance; - }); })(); diff --git a/public/js/icinga/icinga.js b/public/js/icinga/icinga.js index d538ab552..1c28a35f4 100755 --- a/public/js/icinga/icinga.js +++ b/public/js/icinga/icinga.js @@ -80,5 +80,3 @@ define([ }; return new Icinga(); }); - - diff --git a/public/js/main.js b/public/js/main.js index 5e5005ae0..0a6badfa9 100755 --- a/public/js/main.js +++ b/public/js/main.js @@ -24,4 +24,3 @@ define(['jquery','Holder'], function ($) { window.Icinga = Icinga; }); }); -