2015-06-03 14:34:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
|
|
|
class IcingaServiceForm extends DirectorObjectForm
|
|
|
|
{
|
|
|
|
public function setup()
|
|
|
|
{
|
2016-02-17 21:58:28 +01:00
|
|
|
$this->addObjectTypeElement();
|
|
|
|
|
2015-07-30 16:50:48 +02:00
|
|
|
$this->addElement('text', 'object_name', array(
|
|
|
|
'label' => $this->translate('Name'),
|
|
|
|
'required' => true,
|
|
|
|
'description' => $this->translate('Name for the Icinga object you are going to create')
|
2015-06-03 14:34:54 +02:00
|
|
|
));
|
|
|
|
|
2015-07-31 17:36:00 +02:00
|
|
|
/*
|
2015-06-17 11:11:25 +02:00
|
|
|
$this->addElement('text', 'groups', array(
|
|
|
|
'label' => $this->translate('Servicegroups'),
|
|
|
|
'description' => $this->translate('One or more comma separated servicegroup names')
|
|
|
|
));
|
2015-07-31 17:36:00 +02:00
|
|
|
*/
|
2015-12-18 11:59:08 +01:00
|
|
|
$this->optionalBoolean(
|
|
|
|
'use_agent',
|
|
|
|
$this->translate('Run on agent'),
|
|
|
|
$this->translate('Whether the check commmand for this service should be executed on the Icinga agent')
|
|
|
|
);
|
2015-12-23 17:13:24 +01:00
|
|
|
$this->addZoneElement();
|
2015-07-30 16:50:48 +02:00
|
|
|
$this->addImportsElement();
|
2016-02-17 20:10:22 +01:00
|
|
|
$this->addDisabledElement();
|
2015-12-02 03:07:28 +01:00
|
|
|
$this->addCheckCommandElements();
|
|
|
|
|
2015-06-26 16:20:16 +02:00
|
|
|
|
2015-07-30 16:50:48 +02:00
|
|
|
if ($this->isTemplate()) {
|
2015-07-31 16:59:56 +02:00
|
|
|
$this->addCheckExecutionElements();
|
2015-07-30 16:50:48 +02:00
|
|
|
}
|
2015-10-15 23:53:59 +02:00
|
|
|
|
|
|
|
$this->setButtons();
|
2015-06-03 14:34:54 +02:00
|
|
|
}
|
|
|
|
}
|