Implement first commands, fix obsessing state

refs #4441
This commit is contained in:
Jannis Moßhammer 2013-07-31 17:03:21 +02:00 committed by Marius Hein
parent 029ff17cec
commit 1894054929
2 changed files with 28 additions and 0 deletions

View File

@ -645,6 +645,32 @@ class CommandPipe
);
}
public function startObsessing($objects)
{
foreach ($objects as $object) {
$type = $this->getObjectType($object);
$msg = "START_OBSESSING_OVER_". (($type == self::TYPE_SERVICE) ? 'SVC' : 'HOST');
$msg .= ';'.$object->host_name;
if ($type == self::TYPE_SERVICE) {
$msg .= ';'.$object->service_description;
}
$this->send($msg);
}
}
public function stopObsessing($objects)
{
foreach ($objects as $object) {
$type = $this->getObjectType($object);
$msg = "STOP_OBSESSING_OVER_". (($type == self::TYPE_SERVICE) ? 'SVC' : 'HOST');
$msg .= ';'.$object->host_name;
if ($type == self::TYPE_SERVICE) {
$msg .= ';'.$object->service_description;
}
$this->send($msg);
}
}
/**
* Start obsessing over provided services/hosts
*

View File

@ -74,6 +74,7 @@ class PropertyModifier
*/
const FRESHNESS = "%s_FRESHNESS_CHECKS";
/**
* Template for enabling/disabling event handler
*/
@ -90,6 +91,7 @@ class PropertyModifier
self::PASSIVE => self::STATE_KEEP,
self::NOTIFICATIONS => self::STATE_KEEP,
self::FRESHNESS => self::STATE_KEEP,
self::OBSESSING => self::STATE_KEEP,
self::EVENTHANDLER => self::STATE_KEEP
);