Пример #1
0
}
$config_groups = get_config_by_group('alerting');
if (isset($config['base_url'])) {
    $callback = $config['base_url'] . '/' . $_SERVER['REQUEST_URI'] . '/';
} else {
    $callback = get_url() . '/';
}
$callback = urlencode($callback);
$general_conf = array(array('name' => 'alert.disable', 'descr' => 'Disable alerting', 'type' => 'checkbox'), array('name' => 'alert.admins', 'descr' => 'Issue alerts to admins', 'type' => 'checkbox'), array('name' => 'alert.globals', 'descr' => 'Issue alerts to read only users', 'type' => 'checkbox'), array('name' => 'alert.syscontact', 'descr' => 'Issue alerts to sysContact', 'type' => 'checkbox'), array('name' => 'alert.default_only', 'descr' => 'Send alerts to default contact only', 'type' => 'checkbox'), array('name' => 'alert.default_mail', 'descr' => 'Default contact', 'type' => 'text'), array('name' => 'alert.tolerance_window', 'descr' => 'Tolerance window for cron', 'type' => 'text'), array('name' => 'alert.fixed-contacts', 'descr' => 'Updates to contact email addresses not honored', 'type' => 'checkbox'));
$mail_conf = array(array('name' => 'alert.transports.mail', 'descr' => 'Enable email alerting', 'type' => 'checkbox'), array('name' => 'email_backend', 'descr' => 'How to deliver mail', 'options' => $dyn_config['email_backend'], 'type' => 'select'), array('name' => 'email_user', 'descr' => 'From name', 'type' => 'text'), array('name' => 'email_from', 'descr' => 'From email address', 'type' => 'text'), array('name' => 'email_html', 'descr' => 'Use HTML emails', 'type' => 'checkbox'), array('name' => 'email_sendmail_path', 'descr' => 'Sendmail path', 'type' => 'text'), array('name' => 'email_smtp_host', 'descr' => 'SMTP Host', 'type' => 'text'), array('name' => 'email_smtp_port', 'descr' => 'SMTP Port', 'type' => 'text'), array('name' => 'email_smtp_timeout', 'descr' => 'SMTP Timeout', 'type' => 'text'), array('name' => 'email_smtp_secure', 'descr' => 'SMTP Secure', 'type' => 'select', 'options' => $dyn_config['email_smtp_secure']), array('name' => 'email_smtp_auth', 'descr' => 'SMTP Authentication', 'type' => 'checkbox'), array('name' => 'email_smtp_username', 'descr' => 'SMTP Authentication Username', 'type' => 'text'), array('name' => 'email_smtp_password', 'descr' => 'SMTP Authentication Password', 'type' => 'text'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('General alert settings', $config_groups, $general_conf);
echo generate_dynamic_config_panel('Email transport', $config_groups, $mail_conf, 'mail');
echo '
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#api_transport_expand"><i class="fa fa-caret-down"></i> API transport</a> <button name="test-alert" id="test-alert" type="button" data-transport="api" class="btn btn-primary btn-xs pull-right">Test transport</button>
                </h4>
            </div>
            <div id="api_transport_expand" class="panel-collapse collapse">
                <div class="panel-body">
                    <div class="form-group">
                        <div class="col-sm-8">
                            <button class="btn btn-success btn-xs" type="button" name="new_config" id="new_config_item" data-toggle="modal" data-target="#new-config-api">Add API URL</button>
                        </div>
                    </div>';
$api_urls = get_config_like_name('alert.transports.api.%.');
Пример #2
0
<?php

$no_refresh = true;
$config_groups = get_config_by_group('external');
$oxidized_conf = array(array('name' => 'oxidized.enabled', 'descr' => 'Enable Oxidized support', 'type' => 'checkbox'), array('name' => 'oxidized.url', 'descr' => 'URL to your Oxidized API', 'type' => 'text'), array('name' => 'oxidized.features.versioning', 'descr' => 'Enable config versioning access', 'type' => 'checkbox'), array('name' => 'oxidized.group_support', 'descr' => 'Enable the return of groups to Oxidized', 'type' => 'checkbox'), array('name' => 'oxidized.default_group', 'descr' => 'Set the default group returned', 'type' => 'text'));
$unixagent_conf = array(array('name' => 'unix-agent.port', 'descr' => 'Default unix-agent port', 'type' => 'text'), array('name' => 'unix-agent.connection-timeout', 'descr' => 'Connection timeout', 'type' => 'text'), array('name' => 'unix-agent.read-timeout', 'descr' => 'Read timeout', 'type' => 'text'));
$rrdtool_conf = array(array('name' => 'rrdtool', 'descr' => 'Path to rrdtool binary', 'type' => 'text'), array('name' => 'rrdtool_tune', 'descr' => 'Tune all rrd port files to use max values', 'type' => 'checkbox'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('Oxidized integration', true, $config_groups, $oxidized_conf);
echo generate_dynamic_config_panel('Unix-agent integration', true, $config_groups, $unixagent_conf);
echo generate_dynamic_config_panel('RRDTool Setup', true, $config_groups, $rrdtool_conf);
echo '
    </form>
</div>
';
Пример #3
0
<?php

$no_refresh = true;
$config_groups = get_config_by_group('webui');
$search_conf = array(array('name' => 'webui.global_search_result_limit', 'descr' => 'Set the max search result limit', 'type' => 'text'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('Search settings', true, $config_groups, $search_conf);
echo '
    </form>
</div>
';
Пример #4
0
<?php

$no_refresh = true;
$config_groups = get_config_by_group('webui');
$search_conf = array(array('name' => 'webui.global_search_result_limit', 'descr' => 'Set the max search result limit', 'type' => 'text'));
$graph_conf = array(array('name' => 'webui.min_graph_height', 'descr' => 'Set the minimum graph height', 'type' => 'text'));
$availability_map_conf = array(array('name' => 'webui.availability_map_compact', 'descr' => 'Availability map compact view', 'type' => 'checkbox'), array('name' => 'webui.availability_map_sort_status', 'descr' => 'Sort devices by status', 'type' => 'checkbox'), array('name' => 'webui.availability_map_use_device_groups', 'descr' => 'Use device groups filter', 'type' => 'checkbox'), array('name' => 'webui.availability_map_box_size', 'descr' => 'Availability box width', 'type' => 'numeric'));
$dashboard_conf = array(array('name' => 'webui.default_dashboard_id', 'descr' => 'Set global default dashboard id', 'type' => 'select', 'options' => dbFetchRows("SELECT 0 as `value`, 'no default dashboard' as `description`\n               UNION ALL\n               SELECT `dashboards`.`dashboard_id` as `value`,\n                 CONCAT( `users`.`username`, ':', `dashboards`.`dashboard_name`,\n                   CASE\n                     WHEN `dashboards`.`access` = 1 THEN ' (shared, read-only)'\n                     WHEN `dashboards`.`access` = 2 THEN ' (shared, read-write)'\n                     ELSE ''\n                   END\n                 ) as `description`\n               FROM `dashboards` JOIN `users` ON `users`.`user_id` = `dashboards`.`user_id`\n               WHERE `dashboards`.`access` > 0;")));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('Graph settings', $config_groups, $graph_conf);
echo generate_dynamic_config_panel('Search settings', $config_groups, $search_conf);
echo generate_dynamic_config_panel('Availability map settings', $config_groups, $availability_map_conf);
echo generate_dynamic_config_panel('Dashboard settings', $config_groups, $dashboard_conf);
echo '
    </form>
</div>
';
Пример #5
0
<?php

$no_refresh = true;
$config_groups = get_config_by_group('external');
$oxidized_conf = array(array('name' => 'oxidized.enabled', 'descr' => 'Enable Oxidized support', 'type' => 'checkbox'), array('name' => 'oxidized.url', 'descr' => 'URL to your Oxidized API', 'type' => 'text'), array('name' => 'oxidized.features.versioning', 'descr' => 'Enable config versioning access', 'type' => 'checkbox'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('Oxidized integration', true, $config_groups, $oxidized_conf);
echo '
    </form>
</div>
';
Пример #6
0
<?php

$no_refresh = true;
$config_groups = get_config_by_group('external');
$oxidized_conf = array(array('name' => 'oxidized.enabled', 'descr' => 'Enable Oxidized support', 'type' => 'checkbox'), array('name' => 'oxidized.url', 'descr' => 'URL to your Oxidized API', 'type' => 'text'), array('name' => 'oxidized.features.versioning', 'descr' => 'Enable config versioning access', 'type' => 'checkbox'));
$unixagent_conf = array(array('name' => 'unix-agent.port', 'descr' => 'Default unix-agent port', 'type' => 'text'), array('name' => 'unix-agent.connection-timeout', 'descr' => 'Connection timeout', 'type' => 'text'), array('name' => 'unix-agent.read-timeout', 'descr' => 'Read timeout', 'type' => 'text'));
echo '
<div class="panel-group" id="accordion">
    <form class="form-horizontal" role="form" action="" method="post">
';
echo generate_dynamic_config_panel('Oxidized integration', true, $config_groups, $oxidized_conf);
echo generate_dynamic_config_panel('Unix-agent integration', true, $config_groups, $unixagent_conf);
echo '
    </form>
</div>
';