mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
parent
f41d453448
commit
cbf1a30a26
@ -440,8 +440,24 @@ constants
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $objects;
|
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)
|
public function listModuleStages($name, $active = null)
|
||||||
|
@ -57,13 +57,14 @@ class ImportSourceCoreApi extends ImportSourceHook
|
|||||||
protected static function enumObjectTypes($form)
|
protected static function enumObjectTypes($form)
|
||||||
{
|
{
|
||||||
$types = array(
|
$types = array(
|
||||||
'CheckCommand' => $form->translate('Commands'),
|
'CheckCommand' => $form->translate('Check Commands'),
|
||||||
'Endpoint' => $form->translate('Endpoints'),
|
'NotificationCommand' => $form->translate('Notification Commands'),
|
||||||
'Host' => $form->translate('Hosts'),
|
'Endpoint' => $form->translate('Endpoints'),
|
||||||
'HostGroup' => $form->translate('Hostgroups'),
|
'Host' => $form->translate('Hosts'),
|
||||||
'User' => $form->translate('Users'),
|
'HostGroup' => $form->translate('Hostgroups'),
|
||||||
'UserGroup' => $form->translate('Usergroups'),
|
'User' => $form->translate('Users'),
|
||||||
'Zone' => $form->translate('Zones'),
|
'UserGroup' => $form->translate('Usergroups'),
|
||||||
|
'Zone' => $form->translate('Zones'),
|
||||||
);
|
);
|
||||||
|
|
||||||
asort($types);
|
asort($types);
|
||||||
|
@ -300,6 +300,16 @@ class KickstartHelper
|
|||||||
$new->store();
|
$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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user