Vagrant: Add monitoring module config
This commit is contained in:
parent
39c80dccaf
commit
7bf888a554
|
@ -0,0 +1,19 @@
|
|||
[localdb]
|
||||
|
||||
type = ido
|
||||
resource = "ido"
|
||||
|
||||
[locallive]
|
||||
disabled = "1"
|
||||
type = livestatus
|
||||
resource = livestatus
|
||||
|
||||
[localfile]
|
||||
disabled = "1"
|
||||
type = statusdat
|
||||
resource = statusdat
|
||||
|
||||
;[localfailsafe]
|
||||
;enabled=false
|
||||
;type = combo
|
||||
;backends = localdb, locallive, localfile
|
|
@ -0,0 +1,2 @@
|
|||
[icinga]
|
||||
path = "/usr/local/icinga-mysql/var/rw/icinga.cmd"
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
[Problems]
|
||||
priority = 20
|
||||
icon = "img/icons/error.png"
|
||||
|
||||
[Problems.Unhandled Hosts]
|
||||
icon = "img/icons/host.png"
|
||||
priority = 50
|
||||
url = "monitoring/list/hosts?host_problem=1&host_handled=0"
|
||||
|
||||
[Problems.Unhandled Services]
|
||||
icon = "img/icons/service.png"
|
||||
priority = 50
|
||||
url = "monitoring/list/services?service_problem=1&service_handled=0"
|
||||
|
||||
[Problems.Current Downtimes]
|
||||
url = "monitoring/list/downtimes?downtime_is_in_effect=1"
|
||||
icon = "img/icons/down.png"
|
||||
|
||||
[Overview]
|
||||
priority = 30
|
||||
icon = "img/icons/hostgroup.png"
|
||||
|
||||
[Overview.Hosts]
|
||||
title = "Hosts"
|
||||
url = "monitoring/list/hosts"
|
||||
icon = "img/icons/host.png"
|
||||
priority = 50
|
||||
|
||||
[Overview.Services]
|
||||
title = "Services"
|
||||
url = "monitoring/list/services"
|
||||
icon = "img/icons/service.png"
|
||||
priority = 50
|
||||
|
||||
[Overview.Servicegroups]
|
||||
title = "Servicegroups"
|
||||
url = "monitoring/list/servicegroups"
|
||||
icon = "img/icons/servicegroup.png"
|
||||
priority = 60
|
||||
|
||||
[Overview.Hostgroups]
|
||||
title = "Hostgroups"
|
||||
url = "monitoring/list/hostgroups"
|
||||
icon = "img/icons/hostgroup.png"
|
||||
priority = 60
|
||||
|
||||
[Overview.Downtimes]
|
||||
title = "Downtimes"
|
||||
url = "monitoring/list/downtimes"
|
||||
icon = "img/icons/down.png"
|
||||
priority = 70
|
||||
|
||||
[Overview.Comments]
|
||||
title = "Comments"
|
||||
url = "monitoring/list/comments"
|
||||
icon = "img/icons/comment.png"
|
||||
priority = 70
|
||||
|
||||
[History]
|
||||
icon = "img/icons/history.png"
|
||||
|
||||
[History.Notifications]
|
||||
title = "Notifications"
|
||||
url = "monitoring/list/notifications"
|
||||
icon = "img/icons/notification.png"
|
||||
|
||||
[History.Events]
|
||||
title = "All Events"
|
||||
url = "monitoring/list/eventhistory"
|
||||
icon = "img/icons/history.png"
|
||||
|
||||
[System.Performance]
|
||||
title = "Performance"
|
||||
url = "monitoring/process/performance"
|
||||
|
|
@ -637,3 +637,45 @@ file { '/etc/icingaweb/resources.ini':
|
|||
group => 'apache',
|
||||
require => File['/etc/icingaweb']
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/enabledModules':
|
||||
ensure => 'directory',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => File['/etc/icingaweb']
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/modules':
|
||||
ensure => 'directory',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => File['/etc/icingaweb']
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/modules/monitoring':
|
||||
ensure => 'directory',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => File['/etc/icingaweb/modules']
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/modules/monitoring/backends.ini':
|
||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/backends.ini',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => File['/etc/icingaweb/modules/monitoring']
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/modules/monitoring/instances.ini':
|
||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/instances.ini',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => File['/etc/icingaweb/modules/monitoring']
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/modules/monitoring/menu.ini':
|
||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/menu.ini',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => File['/etc/icingaweb/modules/monitoring']
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ class ConfigController extends BaseConfigController
|
|||
{
|
||||
$this->view->messageBox = new AlertMessageBox(true);
|
||||
$form = new GeneralForm();
|
||||
$form->setConfiguration(IcingaConfig::app());
|
||||
//$form->setConfiguration(IcingaConfig::app());
|
||||
$form->setRequest($this->_request);
|
||||
if ($form->isSubmittedAndValid()) {
|
||||
if (!$this->writeConfigFile($form->getConfig(), 'config')) {
|
||||
|
@ -465,11 +465,11 @@ class ConfigController extends BaseConfigController
|
|||
$form = new ConfirmRemovalForm();
|
||||
$form->setRequest($this->getRequest());
|
||||
$form->setRemoveTarget('resource', $name);
|
||||
|
||||
|
||||
// Check if selected resource is currently used for authentication
|
||||
$authConfig = IcingaConfig::app('authentication', true)->toArray();
|
||||
foreach ($authConfig as $backendName => $config) {
|
||||
if (array_key_exists('resource', $config) && $config['resource'] === $name) {
|
||||
if (array_key_exists('resource', $config) && $config['resource'] === $name) {
|
||||
$this->addErrorMessage(
|
||||
'Warning: The resource "' . $name . '" is currently used for user authentication by "' . $backendName . '". ' .
|
||||
' Deleting it could eventally make login impossible.'
|
||||
|
|
|
@ -28,13 +28,14 @@
|
|||
*/
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
use \Icinga\Web\Controller\ActionController;
|
||||
use \Icinga\Web\Url;
|
||||
use \Icinga\Application\Icinga;
|
||||
use \Icinga\Web\Widget\Dashboard;
|
||||
use \Icinga\Application\Config as IcingaConfig;
|
||||
use \Icinga\Form\Dashboard\AddUrlForm;
|
||||
use \Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Web\Controller\ActionController;
|
||||
use Icinga\Web\Url;
|
||||
use Icinga\Web\Widget\Dashboard;
|
||||
use Icinga\Application\Config as IcingaConfig;
|
||||
use Icinga\Form\Dashboard\AddUrlForm;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\NotReadableError;
|
||||
use Icinga\Application\Logger;
|
||||
|
||||
/**
|
||||
* Handle creation, removal and displaying of dashboards, panes and components
|
||||
|
@ -53,7 +54,12 @@ class DashboardController extends ActionController
|
|||
private function getDashboard($config = 'dashboard/dashboard')
|
||||
{
|
||||
$dashboard = new Dashboard();
|
||||
$dashboard->readConfig(IcingaConfig::app($config));
|
||||
try {
|
||||
$dashboardConfig = IcingaConfig::app($config);
|
||||
$dashboard->readConfig($dashboardConfig);
|
||||
} catch (NotReadableError $e) {
|
||||
Logger::exception(new Exception('Cannot load dashboard configuration. An exception was thrown:', 0, $e));
|
||||
}
|
||||
return $dashboard;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,6 @@ class String
|
|||
*/
|
||||
public static function trimSplit($value, $delimiter = ',')
|
||||
{
|
||||
return array_map('trim', explode(',', $value));
|
||||
return array_map('trim', explode($delimiter, $value));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue