mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 15:54:03 +02:00
parent
97ce0b6024
commit
e879b02875
@ -29,6 +29,7 @@ before switching to a new version.
|
|||||||
* FEATURE: new Property Modifier for IPs formatted as number in Excel files (#1296)
|
* FEATURE: new Property Modifier for IPs formatted as number in Excel files (#1296)
|
||||||
* FEATURE: new Property Modifier to url-encode values
|
* FEATURE: new Property Modifier to url-encode values
|
||||||
* FEATURE: new Property Modifier: uppercase the first character of each word
|
* FEATURE: new Property Modifier: uppercase the first character of each word
|
||||||
|
* FEATURE: Kickstart Helper now also imports Event Commands (#1389)
|
||||||
|
|
||||||
### Internals
|
### Internals
|
||||||
* FEATURE: Html/Attribute now allows boolean properties
|
* FEATURE: Html/Attribute now allows boolean properties
|
||||||
|
@ -501,30 +501,33 @@ constants
|
|||||||
*/
|
*/
|
||||||
public function getCheckCommandObjects()
|
public function getCheckCommandObjects()
|
||||||
{
|
{
|
||||||
IcingaCommand::setPluginDir($this->getConstant('PluginDir'));
|
return $this->getSpecificCommandObjects('Command');
|
||||||
|
|
||||||
$objects = $this->getDirectorObjects('Command', 'CheckCommand', 'CheckCommands', array(
|
|
||||||
'arguments' => 'arguments',
|
|
||||||
// 'env' => 'env',
|
|
||||||
'timeout' => 'timeout',
|
|
||||||
'command' => 'command',
|
|
||||||
'vars' => 'vars'
|
|
||||||
));
|
|
||||||
foreach ($objects as $obj) {
|
|
||||||
$obj->methods_execute = 'PluginCheck';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $objects;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IcingaCommand[]
|
* @return IcingaCommand[]
|
||||||
*/
|
*/
|
||||||
public function getNotificationCommandObjects()
|
public function getNotificationCommandObjects()
|
||||||
|
{
|
||||||
|
return $this->getSpecificCommandObjects('Notification');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return IcingaCommand[]
|
||||||
|
*/
|
||||||
|
public function getEventCommandObjects()
|
||||||
|
{
|
||||||
|
return $this->getSpecificCommandObjects('Event');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return IcingaCommand[]
|
||||||
|
*/
|
||||||
|
public function getSpecificCommandObjects($type)
|
||||||
{
|
{
|
||||||
IcingaCommand::setPluginDir($this->getConstant('PluginDir'));
|
IcingaCommand::setPluginDir($this->getConstant('PluginDir'));
|
||||||
|
|
||||||
$objects = $this->getDirectorObjects('Command', 'NotificationCommand', 'NotificationCommands', array(
|
$objects = $this->getDirectorObjects('Command', "${type}Command", "${type}Commands", array(
|
||||||
'arguments' => 'arguments',
|
'arguments' => 'arguments',
|
||||||
// 'env' => 'env',
|
// 'env' => 'env',
|
||||||
'timeout' => 'timeout',
|
'timeout' => 'timeout',
|
||||||
@ -532,7 +535,7 @@ constants
|
|||||||
'vars' => 'vars'
|
'vars' => 'vars'
|
||||||
));
|
));
|
||||||
foreach ($objects as $obj) {
|
foreach ($objects as $obj) {
|
||||||
$obj->methods_execute = 'PluginNotification';
|
$obj->methods_execute = "Plugin$type";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $objects;
|
return $objects;
|
||||||
|
@ -392,24 +392,16 @@ class KickstartHelper
|
|||||||
$zdb = $db->getDbAdapter();
|
$zdb = $db->getDbAdapter();
|
||||||
$zdb->beginTransaction();
|
$zdb->beginTransaction();
|
||||||
/** @var IcingaObject $object */
|
/** @var IcingaObject $object */
|
||||||
foreach ($this->api()->setDb($db)->getCheckCommandObjects() as $object) {
|
foreach (['Check', 'Notification', 'Event'] as $type) {
|
||||||
if ($object::exists($object->object_name, $db)) {
|
foreach ($this->api()->setDb($db)->getSpecificCommandObjects($type) as $object) {
|
||||||
$new = $object::load($object->getObjectName(), $db)->replaceWith($object);
|
if ($object::exists($object->object_name, $db)) {
|
||||||
} else {
|
$new = $object::load($object->getObjectName(), $db)->replaceWith($object);
|
||||||
$new = $object;
|
} else {
|
||||||
}
|
$new = $object;
|
||||||
|
}
|
||||||
$new->store();
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->api()->setDb($db)->getNotificationCommandObjects() as $object) {
|
$new->store();
|
||||||
if ($object::exists($object->object_name, $db)) {
|
|
||||||
$new = $object::load($object->getObjectName(), $db)->replaceWith($object);
|
|
||||||
} else {
|
|
||||||
$new = $object;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$new->store();
|
|
||||||
}
|
}
|
||||||
$zdb->commit();
|
$zdb->commit();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user