2014-10-29 15:40:34 +01:00
|
|
|
<?php
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
// {{{ICINGA_LICENSE_HEADER}}}
|
|
|
|
|
|
|
|
namespace Icinga\Module\Monitoring\Form\Setup;
|
|
|
|
|
|
|
|
use Icinga\Web\Form;
|
|
|
|
use Icinga\Web\Form\Element\Note;
|
|
|
|
use Icinga\Application\Platform;
|
|
|
|
|
|
|
|
class BackendPage extends Form
|
|
|
|
{
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
$this->setName('setup_monitoring_backend');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function createElements(array $formData)
|
|
|
|
{
|
|
|
|
$this->addElement(
|
|
|
|
new Note(
|
|
|
|
'description',
|
|
|
|
array(
|
|
|
|
'value' => mt(
|
|
|
|
'monitoring',
|
|
|
|
'Please configure below how Icinga Web 2 should retrieve monitoring information.'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$this->addElement(
|
|
|
|
'text',
|
|
|
|
'name',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
|
|
|
'label' => mt('monitoring', 'Backend Name'),
|
|
|
|
'description' => mt('monitoring', 'The identifier of this backend')
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$resourceTypes = array('livestatus' => 'Livestatus');
|
2014-11-07 14:31:20 +01:00
|
|
|
if (Platform::extensionLoaded('mysql') || Platform::extensionLoaded('pgsql')) {
|
2014-10-29 15:40:34 +01:00
|
|
|
$resourceTypes['ido'] = 'IDO';
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->addElement(
|
|
|
|
'select',
|
|
|
|
'type',
|
|
|
|
array(
|
|
|
|
'required' => true,
|
|
|
|
'label' => mt('monitoring', 'Backend Type'),
|
|
|
|
'description' => mt('monitoring', 'The data source used for retrieving monitoring information'),
|
|
|
|
'multiOptions' => $resourceTypes
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|