mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-06-09 00:33:03 -04:00
Merge 6edd224753 into 5fc103ffc3
This commit is contained in:
commit
53bfea6dc4
1 changed files with 26 additions and 0 deletions
|
|
@ -748,9 +748,21 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||
);
|
||||
$this->addZoneElement();
|
||||
|
||||
$this->addElement('select', 'command_endpoint_id', [
|
||||
'label' => $this->translate('Command endpoint'),
|
||||
'description' => $this->translate(
|
||||
'Setting a command endpoint allows you to force service checks'
|
||||
. ' to be executed by a specific endpoint. Please carefully'
|
||||
. ' study the related Icinga documentation before using this'
|
||||
. ' feature. Overrides "Run on agent" setting'
|
||||
),
|
||||
'multiOptions' => $this->optionalEnum($this->enumEndpoints())
|
||||
]);
|
||||
|
||||
$elements = array(
|
||||
'use_agent',
|
||||
'zone_id',
|
||||
'command_endpoint_id'
|
||||
);
|
||||
$this->addDisplayGroup($elements, 'clustering', array(
|
||||
'decorators' => array(
|
||||
|
|
@ -765,6 +777,20 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||
return $this;
|
||||
}
|
||||
|
||||
protected function enumEndpoints()
|
||||
{
|
||||
$db = $this->db->getDbAdapter();
|
||||
$select = $db->select()->from('icinga_endpoint', [
|
||||
'id',
|
||||
'object_name'
|
||||
])->where(
|
||||
'object_type IN (?)',
|
||||
['object', 'external_object']
|
||||
)->order('object_name');
|
||||
|
||||
return $db->fetchPairs($select);
|
||||
}
|
||||
|
||||
protected function enumHostsAndTemplates()
|
||||
{
|
||||
if ($this->branch && $this->branch->isBranch()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue