mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
parent
f41d453448
commit
cbf1a30a26
@ -440,8 +440,24 @@ constants
|
||||
}
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
return $this->getObjects('CheckCommand', 'CheckCommands');
|
||||
public function getNotificationCommandObjects()
|
||||
{
|
||||
IcingaCommand::setPluginDir($this->getConstant('PluginDir'));
|
||||
|
||||
$objects = $this->getDirectorObjects('Command', 'NotificationCommand', 'NotificationCommands', array(
|
||||
'arguments' => 'arguments',
|
||||
// 'env' => 'env',
|
||||
'timeout' => 'timeout',
|
||||
'command' => 'command',
|
||||
'vars' => 'vars'
|
||||
));
|
||||
foreach ($objects as $obj) {
|
||||
$obj->methods_execute = 'PluginNotification';
|
||||
}
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function listModuleStages($name, $active = null)
|
||||
|
@ -57,13 +57,14 @@ class ImportSourceCoreApi extends ImportSourceHook
|
||||
protected static function enumObjectTypes($form)
|
||||
{
|
||||
$types = array(
|
||||
'CheckCommand' => $form->translate('Commands'),
|
||||
'Endpoint' => $form->translate('Endpoints'),
|
||||
'Host' => $form->translate('Hosts'),
|
||||
'HostGroup' => $form->translate('Hostgroups'),
|
||||
'User' => $form->translate('Users'),
|
||||
'UserGroup' => $form->translate('Usergroups'),
|
||||
'Zone' => $form->translate('Zones'),
|
||||
'CheckCommand' => $form->translate('Check Commands'),
|
||||
'NotificationCommand' => $form->translate('Notification Commands'),
|
||||
'Endpoint' => $form->translate('Endpoints'),
|
||||
'Host' => $form->translate('Hosts'),
|
||||
'HostGroup' => $form->translate('Hostgroups'),
|
||||
'User' => $form->translate('Users'),
|
||||
'UserGroup' => $form->translate('Usergroups'),
|
||||
'Zone' => $form->translate('Zones'),
|
||||
);
|
||||
|
||||
asort($types);
|
||||
|
@ -300,6 +300,16 @@ class KickstartHelper
|
||||
$new->store();
|
||||
}
|
||||
|
||||
foreach ($this->api()->setDb($db)->getNotificationCommandObjects() as $object) {
|
||||
if ($object::exists($object->object_name, $db)) {
|
||||
$new = $object::load($object->object_name, $db)->replaceWith($object);
|
||||
} else {
|
||||
$new = $object;
|
||||
}
|
||||
|
||||
$new->store();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user