Merge branch 'anadir-nuevos-campos-open' into develop
This commit is contained in:
commit
43ff70c6fb
|
@ -325,6 +325,10 @@ function pluginreg_extension_main () {
|
|||
'unit' => io_safe_input ($unit),
|
||||
'max_timeout' => isset($ini_array[$label]["max_timeout"]) ? $ini_array[$label]["max_timeout"] : '',
|
||||
'history_data' => isset($ini_array[$label]["history_data"]) ? $ini_array[$label]["history_data"] : '',
|
||||
'dynamic_interval' => isset($ini_array[$label]["dynamic_interval"]) ? $ini_array[$label]["dynamic_interval"] : '',
|
||||
'dynamic_min' => isset($ini_array[$label]["dynamic_min"]) ? $ini_array[$label]["dynamic_min"] : '',
|
||||
'dynamic_max' => isset($ini_array[$label]["dynamic_max"]) ? $ini_array[$label]["dynamic_max"] : '',
|
||||
'dynamic_two_tailed' => isset($ini_array[$label]["dynamic_two_tailed"]) ? $ini_array[$label]["dynamic_two_tailed"] : '',
|
||||
'min_warning' => isset($ini_array[$label]["min_warning"]) ? $ini_array[$label]["min_warning"] : '',
|
||||
'max_warning' => isset($ini_array[$label]["max_warning"]) ? $ini_array[$label]["max_warning"] : '',
|
||||
'str_warning' => isset($ini_array[$label]["str_warning"]) ? $ini_array[$label]["str_warning"] : '',
|
||||
|
|
|
@ -608,6 +608,10 @@ function process_upload_xml_component($xml) {
|
|||
$max_timeout = (int)$componentElement->max_timeout;
|
||||
$max_retries = (int)$componentElement->max_retries;
|
||||
$historical_data = (int)$componentElement->historical_data;
|
||||
$dynamic_interval = (int)$componentElement->dynamic_interval;
|
||||
$dynamic_min = (int)$componentElement->dynamic_min;
|
||||
$dynamic_max = (int)$componentElement->dynamic_max;
|
||||
$dynamic_two_tailed = (int)$componentElement->dynamic_two_tailed;
|
||||
$min_war = (float)$componentElement->min_war;
|
||||
$max_war = (float)$componentElement->max_war;
|
||||
$str_war = (string)$componentElement->str_war;
|
||||
|
@ -680,6 +684,10 @@ function process_upload_xml_component($xml) {
|
|||
'max_timeout' => $max_timeout,
|
||||
'max_retries' => $max_retries,
|
||||
'history_data' => $historical_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_war,
|
||||
'max_warning' => $max_war,
|
||||
'str_warning' => $str_war,
|
||||
|
@ -716,6 +724,10 @@ function process_upload_xml_component($xml) {
|
|||
'max_timeout' => $max_timeout,
|
||||
'max_retries' => $max_retries,
|
||||
'history_data' => $historical_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_war,
|
||||
'max_warning' => $max_war,
|
||||
'str_warning' => $str_war,
|
||||
|
@ -754,6 +766,10 @@ function process_upload_xml_component($xml) {
|
|||
'max_timeout' => $max_timeout,
|
||||
'max_retries' => $max_retries,
|
||||
'history_data' => $historical_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_war,
|
||||
'max_warning' => $max_war,
|
||||
'str_warning' => $str_war,
|
||||
|
|
|
@ -68,3 +68,18 @@ ALTER TABLE tevent_filter ADD COLUMN `date_to` date DEFAULT NULL;
|
|||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tusuario ADD (`id_filter` int(10) unsigned NULL default NULL);
|
||||
ALTER TABLE tusuario ADD CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_interval` int(4) unsigned default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_max` int(4) default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_min` int(4) default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0';
|
|
@ -67,3 +67,21 @@ ALTER TABLE tevent_filter ADD COLUMN date_to date DEFAULT NULL;
|
|||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tusuario ADD (id_filter int(10) unsigned NULL default NULL);
|
||||
ALTER TABLE tusuario ADD CONSTRAINT fk_id_filter FOREIGN KEY (id_filter) REFERENCES tevent_filter(id_filter) ON DELETE SET NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_interval int(4) unsigned default '0';
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_max bigint(20) default '0';
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_min bigint(20) default '0';
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_next bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default '0';
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_interval int(4) unsigned default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_max int(4) default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_min int(4) default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_next bigint(20) NOT NULL default '0';
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default '0';
|
|
@ -4,3 +4,21 @@
|
|||
|
||||
ALTER TABLE tagente_estado RENAME COLUMN last_known_status TO known_status;
|
||||
ALTER TABLE tagente_estado ADD COLUMN last_known_status NUMBER(10, 0) DEFAULT 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_interval int(4) unsigned default 0;
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_max bigint(20) default 0;
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_min bigint(20) default 0;
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_next bigint(20) NOT NULL default 0;
|
||||
ALTER TABLE tagente_modulo ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_interval int(4) unsigned default 0;
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_max int(4) default 0;
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_min int(4) default 0;
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_next bigint(20) NOT NULL default 0;
|
||||
ALTER TABLE tnetwork_component ADD COLUMN dynamic_two_tailed tinyint(1) unsigned default 0;
|
|
@ -85,6 +85,10 @@ if (isset ($_POST["template_id"])) {
|
|||
'max_retries' => $row2["max_retries"],
|
||||
'id_plugin' => $row2['id_plugin'],
|
||||
'post_process' => $row2['post_process'],
|
||||
'dynamic_interval' => $row2['dynamic_interval'],
|
||||
'dynamic_max' => $row2['dynamic_max'],
|
||||
'dynamic_min' => $row2['dynamic_min'],
|
||||
'dynamic_two_tailed' => $row2['dynamic_two_tailed'],
|
||||
'min_warning' => $row2['min_warning'],
|
||||
'max_warning' => $row2['max_warning'],
|
||||
'str_warning' => $row2['str_warning'],
|
||||
|
|
|
@ -975,6 +975,10 @@ if ($update_module || $create_module) {
|
|||
$ip_target = (string) get_parameter ('ip_target');
|
||||
$custom_id = (string) get_parameter ('custom_id');
|
||||
$history_data = (int) get_parameter('history_data');
|
||||
$dynamic_interval = (int) get_parameter('dynamic_interval');
|
||||
$dynamic_max = (int) get_parameter('dynamic_max');
|
||||
$dynamic_min = (int) get_parameter('dynamic_min');
|
||||
$dynamic_two_tailed = (int) get_parameter('dynamic_two_tailed');
|
||||
$min_warning = (float) get_parameter ('min_warning');
|
||||
$max_warning = (float) get_parameter ('max_warning');
|
||||
$str_warning = (string) get_parameter ('str_warning');
|
||||
|
@ -1069,6 +1073,10 @@ if ($update_module) {
|
|||
'max_retries' => $max_retries,
|
||||
'custom_id' => $custom_id,
|
||||
'history_data' => $history_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_warning,
|
||||
'max_warning' => $max_warning,
|
||||
'str_warning' => $str_warning,
|
||||
|
@ -1212,6 +1220,10 @@ if ($create_module) {
|
|||
'id_modulo' => $id_module,
|
||||
'custom_id' => $custom_id,
|
||||
'history_data' => $history_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_warning,
|
||||
'max_warning' => $max_warning,
|
||||
'str_warning' => $str_warning,
|
||||
|
|
|
@ -198,6 +198,10 @@ if ($id_agent_module) {
|
|||
$max_retries = $module['max_retries'];
|
||||
$custom_id = $module['custom_id'];
|
||||
$history_data = $module['history_data'];
|
||||
$dynamic_interval = $module['dynamic_interval'];
|
||||
$dynamic_max = $module['dynamic_max'];
|
||||
$dynamic_min = $module['dynamic_min'];
|
||||
$dynamic_two_tailed = $module['dynamic_two_tailed'];
|
||||
$min_warning = $module['min_warning'];
|
||||
$max_warning = $module['max_warning'];
|
||||
$str_warning = $module['str_warning'];
|
||||
|
@ -280,6 +284,10 @@ else {
|
|||
$plugin_parameter = '';
|
||||
$custom_id = '';
|
||||
$history_data = 1;
|
||||
$dynamic_interval = 0;
|
||||
$dynamic_min = 0;
|
||||
$dynamic_max = 0;
|
||||
$dynamic_two_tailed = 0;
|
||||
$min_warning = 0;
|
||||
$max_warning = 0;
|
||||
$str_warning = '';
|
||||
|
|
|
@ -228,70 +228,78 @@ $table_simple->data[1][3] = html_print_select_from_sql ('SELECT id_mg, name FROM
|
|||
if($disabledBecauseInPolicy){
|
||||
$table_simple->data[1][3] .= html_print_input_hidden ('id_module_group', $id_module_group, true);
|
||||
}
|
||||
$table_simple->data[2][0] = __('Dynamic Interval') .' ' . ui_print_help_icon ('warning_status', true);
|
||||
html_debug_print($dynamic_interval);
|
||||
$table_simple->data[2][1] = html_print_extended_select_for_time ('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px',false);
|
||||
$table_simple->data[2][2] = '<span><em>'.__('Dynamic Min. ').'</em>';
|
||||
$table_simple->data[2][2] .= html_print_input_text ('dynamic_min', $dynamic_min, '', 10, 255, true);
|
||||
$table_simple->data[2][2] .= '<br /><em>'.__('Dynamic Max.').'</em>';
|
||||
$table_simple->data[2][2] .= html_print_input_text ('dynamic_max', $dynamic_max, '', 10, 255, true);
|
||||
$table_simple->data[2][3] = '<span><em>'.__('Dynamic Two Tailed: ').'</em>';
|
||||
$table_simple->data[2][3] .= html_print_checkbox ("dynamic_two_tailed", 1, $dynamic_two_tailed, true);
|
||||
$table_simple->data[3][0] = __('Warning status').' ' . ui_print_help_icon ('warning_status', true);
|
||||
|
||||
$table_simple->data[2][0] = __('Warning status').' ' . ui_print_help_icon ('warning_status', true);
|
||||
|
||||
$table_simple->data[2][1] = '';
|
||||
$table_simple->data[3][1] = '';
|
||||
|
||||
if (!modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[2][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_text ('min_warning', $min_warning,
|
||||
$table_simple->data[3][1] .= '<span id="minmax_warning"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_input_text ('min_warning', $min_warning,
|
||||
'', 10, 255, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[2][1] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_text ('max_warning', $max_warning,
|
||||
$table_simple->data[3][1] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_input_text ('max_warning', $max_warning,
|
||||
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
|
||||
}
|
||||
if (modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[2][1] .= '<span id="string_warning"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_input_text ('str_warning', $str_warning,
|
||||
$table_simple->data[3][1] .= '<span id="string_warning"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_input_text ('str_warning', $str_warning,
|
||||
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
|
||||
}
|
||||
|
||||
$table_simple->data[2][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[2][1] .= html_print_checkbox ("warning_inverse", 1,
|
||||
$table_simple->data[3][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[3][1] .= html_print_checkbox ("warning_inverse", 1,
|
||||
$warning_inverse, true);
|
||||
$table_simple->data[2][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true);
|
||||
$table_simple->data[2][3] = '';
|
||||
$table_simple->data[3][2] = __('Critical status').' ' . ui_print_help_icon ('critical_status', true);
|
||||
$table_simple->data[3][3] = '';
|
||||
|
||||
if (!modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[2][3] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[2][3] .= html_print_input_text ('min_critical', $min_critical,
|
||||
$table_simple->data[3][3] .= '<span id="minmax_critical"><em>'.__('Min. ').'</em>';
|
||||
$table_simple->data[3][3] .= html_print_input_text ('min_critical', $min_critical,
|
||||
'', 10, 255, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[2][3] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[2][3] .= html_print_input_text ('max_critical', $max_critical,
|
||||
$table_simple->data[3][3] .= '<br /><em>'.__('Max.').'</em>';
|
||||
$table_simple->data[3][3] .= html_print_input_text ('max_critical', $max_critical,
|
||||
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
|
||||
}
|
||||
if (modules_is_string_type($id_module_type) || $edit) {
|
||||
$table_simple->data[2][3] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[2][3] .= html_print_input_text ('str_critical', $str_critical,
|
||||
$table_simple->data[3][3] .= '<span id="string_critical"><em>'.__('Str.').'</em>';
|
||||
$table_simple->data[3][3] .= html_print_input_text ('str_critical', $str_critical,
|
||||
'', 10, 255, true, $disabledBecauseInPolicy).'</span>';
|
||||
}
|
||||
|
||||
$table_simple->data[2][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[2][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||
$table_simple->data[3][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table_simple->data[3][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||
|
||||
/* FF stands for Flip-flop */
|
||||
$table_simple->data[3][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true);
|
||||
$table_simple->colspan[3][1] = 3;
|
||||
$table_simple->data[4][0] = __('FF threshold').' ' . ui_print_help_icon ('ff_threshold', true);
|
||||
$table_simple->colspan[4][1] = 3;
|
||||
|
||||
$table_simple->data[3][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true) . ' ' . __('All state changing') . ' : ';
|
||||
$table_simple->data[3][1] .= html_print_input_text ('ff_event', $ff_event, '', 5
|
||||
$table_simple->data[4][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true) . ' ' . __('All state changing') . ' : ';
|
||||
$table_simple->data[4][1] .= html_print_input_text ('ff_event', $ff_event, '', 5
|
||||
, 15, true, $disabledBecauseInPolicy) . '<br />';
|
||||
$table_simple->data[3][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true) . ' ' . __('Each state changing') . ' : ';
|
||||
$table_simple->data[3][1] .= __('To normal');
|
||||
$table_simple->data[3][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
|
||||
$table_simple->data[3][1] .= __('To warning');
|
||||
$table_simple->data[3][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
|
||||
$table_simple->data[3][1] .= __('To critical');
|
||||
$table_simple->data[3][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[4][0] = __('Historical data');
|
||||
$table_simple->data[4][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true) . ' ' . __('Each state changing') . ' : ';
|
||||
$table_simple->data[4][1] .= __('To normal');
|
||||
$table_simple->data[4][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
|
||||
$table_simple->data[4][1] .= __('To warning');
|
||||
$table_simple->data[4][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true, $disabledBecauseInPolicy) . ' ';
|
||||
$table_simple->data[4][1] .= __('To critical');
|
||||
$table_simple->data[4][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[5][0] = __('Historical data');
|
||||
if($disabledBecauseInPolicy) {
|
||||
// If is disabled, we send a hidden in his place and print a false checkbox because HTML dont send disabled fields and could be disabled by error
|
||||
$table_simple->data[4][1] = html_print_checkbox ("history_data_fake", 1, $history_data, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[4][1] .= '<input type="hidden" name="history_data" value="'.(int)$history_data.'">';
|
||||
$table_simple->data[5][1] = html_print_checkbox ("history_data_fake", 1, $history_data, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[5][1] .= '<input type="hidden" name="history_data" value="'.(int)$history_data.'">';
|
||||
}
|
||||
else {
|
||||
$table_simple->data[4][1] = html_print_checkbox ("history_data", 1, $history_data, true, $disabledBecauseInPolicy);
|
||||
$table_simple->data[5][1] = html_print_checkbox ("history_data", 1, $history_data, true, $disabledBecauseInPolicy);
|
||||
}
|
||||
|
||||
/* Advanced form part */
|
||||
|
@ -799,9 +807,36 @@ $(document).ready (function () {
|
|||
$("#submit-crtbutton").click (function () {
|
||||
validate_post_process();
|
||||
});
|
||||
//Dynamic_interval;
|
||||
disabled_status();
|
||||
$('#dynamic_interval_select').change (function() {
|
||||
disabled_status();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function disabled_status () {
|
||||
if($('#dynamic_interval_select').val() != 0){
|
||||
$('#text-min_warning').prop('readonly', true);
|
||||
$('#text-min_warning').addClass('readonly');
|
||||
$('#text-max_warning').prop('readonly', true);
|
||||
$('#text-max_warning').addClass('readonly');
|
||||
$('#text-min_critical').prop('readonly', true);
|
||||
$('#text-min_critical').addClass('readonly');
|
||||
$('#text-max_critical').prop('readonly', true);
|
||||
$('#text-max_critical').addClass('readonly');
|
||||
} else {
|
||||
$('#text-min_warning').prop('readonly', false);
|
||||
$('#text-min_warning').removeClass('readonly');
|
||||
$('#text-max_warning').prop('readonly', false);
|
||||
$('#text-max_warning').removeClass('readonly');
|
||||
$('#text-min_critical').prop('readonly', false);
|
||||
$('#text-min_critical').removeClass('readonly');
|
||||
$('#text-max_critical').prop('readonly', false);
|
||||
$('#text-max_critical').removeClass('readonly');
|
||||
}
|
||||
}
|
||||
|
||||
// Add a new module macro
|
||||
function add_macro () {
|
||||
var macro_count = parseInt($("#hidden-module_macro_count").val());
|
||||
|
|
|
@ -176,6 +176,7 @@ $table->size[2] = '15%';
|
|||
$table->size[3] = '35%';
|
||||
if (! $module_type) {
|
||||
$table->rowstyle['edit1'] = 'display: none';
|
||||
$table->rowstyle['edit0'] = 'display: none';
|
||||
$table->rowstyle['edit1_1'] = 'display: none';
|
||||
$table->rowstyle['edit2'] = 'display: none';
|
||||
$table->rowstyle['edit3'] = 'display: none';
|
||||
|
@ -340,7 +341,16 @@ $table->data['form_agents_3'][3] = html_print_select (array(), 'module[]',
|
|||
$modules_select, false, '', '', true, true, false);
|
||||
|
||||
|
||||
|
||||
$table->data['edit0'][0] = __('Dynamic Interval');
|
||||
$table->data['edit0'][1] = html_print_extended_select_for_time ('dynamic_interval', '', '', 'None', '0', 10, true, 'width:150px',false);
|
||||
$table->data['edit0'][2] = '<table width="100%"><tr><td><em>' . __('Dynamic Min.') . '</em></td>';
|
||||
$table->data['edit0'][2] .= '<td align="right">' .
|
||||
html_print_input_text ('dynamic_min', '', '', 10, 255, true) . '</td></tr>';
|
||||
$table->data['edit0'][2] .= '<tr><td><em>' . __('Dynamic Max.') . '</em></td>';
|
||||
$table->data['edit0'][2] .= '<td align="right">' .
|
||||
html_print_input_text ('dynamic_max', '', '', 10, 255, true) . '</td></tr></table>';
|
||||
$table->data['edit0'][3] = __('Dynamic Two Tailed: ');
|
||||
$table->data['edit0'][3] .= html_print_checkbox ("dynamic_two_tailed", 1, '', true);
|
||||
|
||||
$table->data['edit1'][0] = __('Warning status');
|
||||
$table->data['edit1'][1] = '<table width="100%">';
|
||||
|
@ -656,6 +666,7 @@ $(document).ready (function () {
|
|||
}
|
||||
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -685,7 +696,7 @@ $(document).ready (function () {
|
|||
params['id_tipo_modulo'] = this.value;
|
||||
|
||||
$("#module_loading").show ();
|
||||
$("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
|
||||
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
|
||||
$("#module_name").attr ("disabled", "disabled")
|
||||
$("#module_name option[value!=0]").remove ();
|
||||
jQuery.post ("ajax.php",
|
||||
|
@ -708,6 +719,7 @@ $(document).ready (function () {
|
|||
$("#form_edit input[type=text]").attr ("value", "");
|
||||
$("#form_edit input[type=checkbox]").not ("#checkbox-recursion").removeAttr ("checked");
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -733,6 +745,7 @@ $(document).ready (function () {
|
|||
$("#agents").html('<?php echo __('None'); ?>');
|
||||
$("#module").html('<?php echo __('None'); ?>');
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -766,6 +779,7 @@ $(document).ready (function () {
|
|||
if (this.checked) {
|
||||
$(".select_modules_row_2").css('display', 'none');
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -782,6 +796,7 @@ $(document).ready (function () {
|
|||
$(".select_modules_row_2").css('display', '');
|
||||
if ($('#module_name option:selected').val() == undefined) {
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -812,6 +827,9 @@ $(document).ready (function () {
|
|||
else if (this.id == "checkbox-critical_inverse") {
|
||||
return; //Do none
|
||||
}
|
||||
else if (this.id == "checkbox-dynamic_two_tailed") {
|
||||
return; //Do none
|
||||
}
|
||||
else {
|
||||
if (this.id == "checkbox-force_group") {
|
||||
$("#checkbox-recursion").attr("checked", false);
|
||||
|
@ -820,6 +838,7 @@ $(document).ready (function () {
|
|||
if (this.checked) {
|
||||
$(".select_agents_row_2").css('display', 'none');
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -842,6 +861,7 @@ $(document).ready (function () {
|
|||
$(".select_agents_row_2").css('display', '');
|
||||
if ($('#id_agents option:selected').val() == undefined) {
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -916,6 +936,7 @@ $(document).ready (function () {
|
|||
}
|
||||
|
||||
$("tr#delete_table-edit1, " +
|
||||
"tr#delete_table-edit0, " +
|
||||
"tr#delete_table-edit1_1, " +
|
||||
"tr#delete_table-edit2, " +
|
||||
"tr#delete_table-edit3, " +
|
||||
|
@ -966,7 +987,35 @@ $(document).ready (function () {
|
|||
$("#status_agents").change(function() {
|
||||
$("#groups_select").trigger("change");
|
||||
});
|
||||
|
||||
//Dynamic_interval;
|
||||
disabled_status();
|
||||
$('#dynamic_interval_select').change (function() {
|
||||
disabled_status();
|
||||
});
|
||||
});
|
||||
|
||||
function disabled_status () {
|
||||
if($('#dynamic_interval_select').val() != 0){
|
||||
$('#text-min_warning').prop('readonly', true);
|
||||
$('#text-min_warning').addClass('readonly');
|
||||
$('#text-max_warning').prop('readonly', true);
|
||||
$('#text-max_warning').addClass('readonly');
|
||||
$('#text-min_critical').prop('readonly', true);
|
||||
$('#text-min_critical').addClass('readonly');
|
||||
$('#text-max_critical').prop('readonly', true);
|
||||
$('#text-max_critical').addClass('readonly');
|
||||
} else {
|
||||
$('#text-min_warning').prop('readonly', false);
|
||||
$('#text-min_warning').removeClass('readonly');
|
||||
$('#text-max_warning').prop('readonly', false);
|
||||
$('#text-max_warning').removeClass('readonly');
|
||||
$('#text-min_critical').prop('readonly', false);
|
||||
$('#text-min_critical').removeClass('readonly');
|
||||
$('#text-max_critical').prop('readonly', false);
|
||||
$('#text-max_critical').removeClass('readonly');
|
||||
}
|
||||
}
|
||||
/* ]]> */
|
||||
</script>
|
||||
<?php
|
||||
|
@ -982,7 +1031,7 @@ function process_manage_edit ($module_name, $agents_select = null) {
|
|||
$agents_select = array($agents_select);
|
||||
|
||||
/* List of fields which can be updated */
|
||||
$fields = array ('min_warning', 'max_warning', 'str_warning',
|
||||
$fields = array ('dynamic_interval', 'dynamic_max', 'dynamic_min', 'dynamic_two_tailed', 'min_warning', 'max_warning', 'str_warning',
|
||||
'min_critical', 'max_critical', 'str_critical', 'min_ff_event',
|
||||
'module_interval', 'disabled', 'post_process', 'unit',
|
||||
'snmp_community', 'tcp_send', 'custom_string_1',
|
||||
|
|
|
@ -86,6 +86,10 @@ $max_timeout = (int) get_parameter ('max_timeout');
|
|||
$max_retries = (int) get_parameter ('max_retries');
|
||||
$id_modulo = (int) get_parameter ('id_component_type');
|
||||
$id_plugin = (int) get_parameter ('id_plugin');
|
||||
$dynamic_interval = (int) get_parameter('dynamic_interval');
|
||||
$dynamic_max = (int) get_parameter('dynamic_max');
|
||||
$dynamic_min = (int) get_parameter('dynamic_min');
|
||||
$dynamic_two_tailed = (int) get_parameter('dynamic_two_tailed');
|
||||
$min_warning = (float) get_parameter ('min_warning');
|
||||
$max_warning = (float) get_parameter ('max_warning');
|
||||
$str_warning = (string) get_parameter ('str_warning');
|
||||
|
@ -212,6 +216,10 @@ if ($create_component) {
|
|||
'max_timeout' => $max_timeout,
|
||||
'max_retries' => $max_retries,
|
||||
'history_data' => $history_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_warning,
|
||||
'max_warning' => $max_warning,
|
||||
'str_warning' => $str_warning,
|
||||
|
@ -298,6 +306,10 @@ if ($update_component) {
|
|||
'max_timeout' => $max_timeout,
|
||||
'max_retries' => $max_retries,
|
||||
'history_data' => $history_data,
|
||||
'dynamic_interval' => $dynamic_interval,
|
||||
'dynamic_max' => $dynamic_max,
|
||||
'dynamic_min' => $dynamic_min,
|
||||
'dynamic_two_tailed' => $dynamic_two_tailed,
|
||||
'min_warning' => $min_warning,
|
||||
'max_warning' => $max_warning,
|
||||
'str_warning' => $str_warning,
|
||||
|
@ -426,6 +438,10 @@ $url = ui_get_url_refresh (array ('offset' => false,
|
|||
'id_modulo' => false,
|
||||
'id_plugin' => false,
|
||||
'history_data' => false,
|
||||
'dynamic_interval' => false,
|
||||
'dynamic_max' => false,
|
||||
'dynamic_min' => false,
|
||||
'dynamic_two_tailed' => false,
|
||||
'min_warning' => false,
|
||||
'max_warning' => false,
|
||||
'str_warning' => false,
|
||||
|
|
|
@ -53,6 +53,10 @@ if ($create_network_from_module) {
|
|||
$macros = $data_module["macros"];
|
||||
$max_timeout = $data_module["max_timeout"];
|
||||
$max_retries = $data_module["max_retries"];
|
||||
$dynamic_interval = $data_module['dynamic_interval'];
|
||||
$dynamic_max = $data_module['dynamic_max'];
|
||||
$dynamic_min = $data_module['dynamic_min'];
|
||||
$dynamic_two_tailed = $data_module['dynamic_two_tailed'];
|
||||
$min_warning = $data_module["min_warning"];
|
||||
$max_warning = $data_module["max_warning"];
|
||||
$str_warning = $data_module["str_warning"];
|
||||
|
@ -106,6 +110,10 @@ if (isset ($id)) {
|
|||
$macros = $component["macros"];
|
||||
$max_timeout = $component["max_timeout"];
|
||||
$max_retries = $component["max_retries"];
|
||||
$dynamic_interval = $component['dynamic_interval'];
|
||||
$dynamic_max = $component['dynamic_max'];
|
||||
$dynamic_min = $component['dynamic_min'];
|
||||
$dynamic_two_tailed = $component['dynamic_two_tailed'];
|
||||
$min_warning = $component["min_warning"];
|
||||
$max_warning = $component["max_warning"];
|
||||
$str_warning = $component["str_warning"];
|
||||
|
@ -161,6 +169,10 @@ if (isset ($id)) {
|
|||
$min_warning = 0;
|
||||
$max_warning = 0;
|
||||
$str_warning = '';
|
||||
$dynamic_interval = 0;
|
||||
$dynamic_min = 0;
|
||||
$dynamic_max = 0;
|
||||
$dynamic_two_tailed = 0;
|
||||
$max_critical = 0;
|
||||
$min_critical = 0;
|
||||
$str_critical = '';
|
||||
|
|
|
@ -102,73 +102,82 @@ $table->data[2][1] = html_print_select (network_components_get_groups (),
|
|||
$table->data[2][2] = __('Interval');
|
||||
$table->data[2][3] = html_print_extended_select_for_time ('module_interval' , $module_interval, '', '', '0', false, true);
|
||||
|
||||
$table->data[3][0] = __('Dynamic Interval') .' ' . ui_print_help_icon ('warning_status', true);
|
||||
html_debug_print($dynamic_interval);
|
||||
$table->data[3][1] = html_print_extended_select_for_time ('dynamic_interval', $dynamic_interval, '', 'None', '0', 10, true, 'width:150px',false);
|
||||
$table->data[3][2] = '<span><em>'.__('Dynamic Min. ').'</em>';
|
||||
$table->data[3][2] .= html_print_input_text ('dynamic_min', $dynamic_min, '', 10, 255, true);
|
||||
$table->data[3][2] .= '<br /><em>'.__('Dynamic Max.').'</em>';
|
||||
$table->data[3][2] .= html_print_input_text ('dynamic_max', $dynamic_max, '', 10, 255, true);
|
||||
$table->data[3][3] = '<span><em>'.__('Dynamic Two Tailed: ').'</em>';
|
||||
$table->data[3][3] .= html_print_checkbox ("dynamic_two_tailed", 1, $dynamic_two_tailed, true);
|
||||
|
||||
$table->data[3][0] = __('Warning status') . ' ' . ui_print_help_icon ('warning_status', true);
|
||||
$table->data[3][1] = '<span id="minmax_warning"><em>'.__('Min.').' </em> ';
|
||||
$table->data[3][1] .= html_print_input_text ('min_warning', $min_warning,
|
||||
$table->data[4][0] = __('Warning status') . ' ' . ui_print_help_icon ('warning_status', true);
|
||||
$table->data[4][1] = '<span id="minmax_warning"><em>'.__('Min.').' </em> ';
|
||||
$table->data[4][1] .= html_print_input_text ('min_warning', $min_warning,
|
||||
'', 5, 15, true);
|
||||
$table->data[3][1] .= '<br /><em>'.__('Max.').'</em> ';
|
||||
$table->data[3][1] .= html_print_input_text ('max_warning', $max_warning,
|
||||
$table->data[4][1] .= '<br /><em>'.__('Max.').'</em> ';
|
||||
$table->data[4][1] .= html_print_input_text ('max_warning', $max_warning,
|
||||
'', 5, 15, true) . '</span>';
|
||||
$table->data[3][1] .= '<span id="string_warning"><em>'.__('Str.').' </em> ';
|
||||
$table->data[3][1] .= html_print_input_text ('str_warning', $str_warning,
|
||||
$table->data[4][1] .= '<span id="string_warning"><em>'.__('Str.').' </em> ';
|
||||
$table->data[4][1] .= html_print_input_text ('str_warning', $str_warning,
|
||||
'', 5, 15, true) . '</span>';
|
||||
$table->data[3][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[3][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
|
||||
$table->data[4][1] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[4][1] .= html_print_checkbox ("warning_inverse", 1, $warning_inverse, true);
|
||||
|
||||
$table->data[3][2] = __('Critical status'). ' ' . ui_print_help_icon ('critical_status', true);
|
||||
$table->data[3][3] = '<span id="minmax_critical"><em>'.__('Min.').' </em> ';
|
||||
$table->data[3][3] .= html_print_input_text ('min_critical', $min_critical,
|
||||
$table->data[4][2] = __('Critical status'). ' ' . ui_print_help_icon ('critical_status', true);
|
||||
$table->data[4][3] = '<span id="minmax_critical"><em>'.__('Min.').' </em> ';
|
||||
$table->data[4][3] .= html_print_input_text ('min_critical', $min_critical,
|
||||
'', 5, 15, true);
|
||||
$table->data[3][3] .= '<br /><em>'.__('Max.').'</em> ';
|
||||
$table->data[3][3] .= html_print_input_text ('max_critical', $max_critical,
|
||||
$table->data[4][3] .= '<br /><em>'.__('Max.').'</em> ';
|
||||
$table->data[4][3] .= html_print_input_text ('max_critical', $max_critical,
|
||||
'', 5, 15, true) . '</span>';
|
||||
$table->data[3][3] .= '<span id="string_critical"><em>'.__('Str.').' </em> ';
|
||||
$table->data[3][3] .= html_print_input_text ('str_critical', $str_critical,
|
||||
$table->data[4][3] .= '<span id="string_critical"><em>'.__('Str.').' </em> ';
|
||||
$table->data[4][3] .= html_print_input_text ('str_critical', $str_critical,
|
||||
'', 5, 15, true) . '</span>';
|
||||
$table->data[3][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[3][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||
$table->data[4][3] .= '<br /><em>'.__('Inverse interval').'</em>';
|
||||
$table->data[4][3] .= html_print_checkbox ("critical_inverse", 1, $critical_inverse, true);
|
||||
|
||||
$table->data[4][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true);
|
||||
$table->colspan[4][1] = 3;
|
||||
$table->data[4][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true) . ' ' . __('All state changing') . ' : ';
|
||||
$table->data[4][1] .= html_print_input_text ('ff_event', $ff_event,
|
||||
$table->data[5][0] = __('FF threshold') . ' ' . ui_print_help_icon ('ff_threshold', true);
|
||||
$table->colspan[5][1] = 3;
|
||||
$table->data[5][1] = html_print_radio_button ('each_ff', 0, '', $each_ff, true) . ' ' . __('All state changing') . ' : ';
|
||||
$table->data[5][1] .= html_print_input_text ('ff_event', $ff_event,
|
||||
'', 5, 15, true) . '<br />';
|
||||
$table->data[4][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true) . ' ' . __('Each state changing') . ' : ';
|
||||
$table->data[4][1] .= __('To normal');
|
||||
$table->data[4][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true) . ' ';
|
||||
$table->data[4][1] .= __('To warning');
|
||||
$table->data[4][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true) . ' ';
|
||||
$table->data[4][1] .= __('To critical');
|
||||
$table->data[4][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true);
|
||||
$table->data[5][1] .= html_print_radio_button ('each_ff', 1, '', $each_ff, true) . ' ' . __('Each state changing') . ' : ';
|
||||
$table->data[5][1] .= __('To normal');
|
||||
$table->data[5][1] .= html_print_input_text ('ff_event_normal', $ff_event_normal, '', 5, 15, true) . ' ';
|
||||
$table->data[5][1] .= __('To warning');
|
||||
$table->data[5][1] .= html_print_input_text ('ff_event_warning', $ff_event_warning, '', 5, 15, true) . ' ';
|
||||
$table->data[5][1] .= __('To critical');
|
||||
$table->data[5][1] .= html_print_input_text ('ff_event_critical', $ff_event_critical, '', 5, 15, true);
|
||||
|
||||
$table->data[5][0] = __('Historical data');
|
||||
$table->data[5][1] = html_print_checkbox ("history_data", 1, $history_data, true);
|
||||
$table->data[6][0] = __('Historical data');
|
||||
$table->data[6][1] = html_print_checkbox ("history_data", 1, $history_data, true);
|
||||
|
||||
$table->data[6][0] = __('Min. Value');
|
||||
$table->data[6][1] = html_print_input_text ('min', $min, '', 5, 15, true). ' ' . ui_print_help_tip (__('Any value below this number is discarted'), true);
|
||||
$table->data[6][2] = __('Max. Value');
|
||||
$table->data[6][3] = html_print_input_text ('max', $max, '', 5, 15, true) . ' ' . ui_print_help_tip (__('Any value over this number is discarted'), true);
|
||||
$table->data[7][0] = __('Unit');
|
||||
$table->data[7][1] = html_print_input_text ('unit', $unit, '', 12, 25, true);
|
||||
$table->data[7][0] = __('Min. Value');
|
||||
$table->data[7][1] = html_print_input_text ('min', $min, '', 5, 15, true). ' ' . ui_print_help_tip (__('Any value below this number is discarted'), true);
|
||||
$table->data[7][2] = __('Max. Value');
|
||||
$table->data[7][3] = html_print_input_text ('max', $max, '', 5, 15, true) . ' ' . ui_print_help_tip (__('Any value over this number is discarted'), true);
|
||||
$table->data[8][0] = __('Unit');
|
||||
$table->data[8][1] = html_print_input_text ('unit', $unit, '', 12, 25, true);
|
||||
|
||||
$table->data[7][2] = __('Throw unknown events');
|
||||
$table->data[7][3] = html_print_checkbox('throw_unknown_events', 1,
|
||||
$table->data[8][2] = __('Throw unknown events');
|
||||
$table->data[8][3] = html_print_checkbox('throw_unknown_events', 1,
|
||||
!network_components_is_disable_type_event($id, EVENTS_GOING_UNKNOWN), true);
|
||||
|
||||
$table->data[8][0] = __('Critical instructions'). ui_print_help_tip(__("Instructions when the status is critical"), true);
|
||||
$table->data[8][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, '', true);
|
||||
$table->colspan[8][1] = 3;
|
||||
|
||||
$table->data[9][0] = __('Warning instructions'). ui_print_help_tip(__("Instructions when the status is warning"), true);
|
||||
$table->data[9][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, '', true);
|
||||
$table->data[9][0] = __('Critical instructions'). ui_print_help_tip(__("Instructions when the status is critical"), true);
|
||||
$table->data[9][1] = html_print_textarea ('critical_instructions', 2, 65, $critical_instructions, '', true);
|
||||
$table->colspan[9][1] = 3;
|
||||
|
||||
$table->data[10][0] = __('Unknown instructions'). ui_print_help_tip(__("Instructions when the status is unknown"), true);
|
||||
$table->data[10][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
|
||||
$table->data[10][0] = __('Warning instructions'). ui_print_help_tip(__("Instructions when the status is warning"), true);
|
||||
$table->data[10][1] = html_print_textarea ('warning_instructions', 2, 65, $warning_instructions, '', true);
|
||||
$table->colspan[10][1] = 3;
|
||||
|
||||
$next_row = 11;
|
||||
$table->data[11][0] = __('Unknown instructions'). ui_print_help_tip(__("Instructions when the status is unknown"), true);
|
||||
$table->data[11][1] = html_print_textarea ('unknown_instructions', 2, 65, $unknown_instructions, '', true);
|
||||
$table->colspan[11][1] = 3;
|
||||
|
||||
$next_row = 12;
|
||||
|
||||
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||
$table->data[$next_row][0] = __('Category');
|
||||
|
@ -178,7 +187,7 @@ if (check_acl ($config['id_user'], 0, "PM")) {
|
|||
}
|
||||
else {
|
||||
// Store in a hidden field if is not visible to avoid delete the value
|
||||
$table->data[10][1] .= html_print_input_hidden ('id_category', $id_category, true);
|
||||
$table->data[11][1] .= html_print_input_hidden ('id_category', $id_category, true);
|
||||
}
|
||||
|
||||
$table->data[$next_row][0] = __('Tags');
|
||||
|
@ -237,7 +246,33 @@ $next_row++;
|
|||
$('#minmax_warning').hide();
|
||||
}
|
||||
});
|
||||
|
||||
//Dynamic_interval;
|
||||
disabled_status();
|
||||
$('#dynamic_interval_select').change (function() {
|
||||
disabled_status();
|
||||
});
|
||||
$("#type").trigger('change');
|
||||
});
|
||||
|
||||
function disabled_status () {
|
||||
if($('#dynamic_interval_select').val() != 0){
|
||||
$('#text-min_warning').prop('readonly', true);
|
||||
$('#text-min_warning').addClass('readonly');
|
||||
$('#text-max_warning').prop('readonly', true);
|
||||
$('#text-max_warning').addClass('readonly');
|
||||
$('#text-min_critical').prop('readonly', true);
|
||||
$('#text-min_critical').addClass('readonly');
|
||||
$('#text-max_critical').prop('readonly', true);
|
||||
$('#text-max_critical').addClass('readonly');
|
||||
} else {
|
||||
$('#text-min_warning').prop('readonly', false);
|
||||
$('#text-min_warning').removeClass('readonly');
|
||||
$('#text-max_warning').prop('readonly', false);
|
||||
$('#text-max_warning').removeClass('readonly');
|
||||
$('#text-min_critical').prop('readonly', false);
|
||||
$('#text-min_critical').removeClass('readonly');
|
||||
$('#text-max_critical').prop('readonly', false);
|
||||
$('#text-max_critical').removeClass('readonly');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -103,7 +103,7 @@ if ($export_profile) {
|
|||
components.tcp_port, components.tcp_send, components.tcp_rcv, components.snmp_community, components.snmp_oid,
|
||||
components.id_module_group, components.id_modulo, components.plugin_user, components.plugin_pass, components.plugin_parameter,
|
||||
components.max_timeout, components.max_retries, components.history_data, components.min_warning, components.max_warning, components.str_warning, components.min_critical,
|
||||
components.max_critical, components.str_critical, components.min_ff_event, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions
|
||||
components.max_critical, components.str_critical, components.min_ff_event, components.dynamic_interval, components.dynamic_max, components.dynamic_min, components.dynamic_two_tailed, comp_group.name AS group_name, components.critical_instructions, components.warning_instructions, components.unknown_instructions
|
||||
FROM `tnetwork_component` AS components, tnetwork_profile_component AS tpc, tnetwork_component_group AS comp_group
|
||||
WHERE tpc.id_nc = components.id_nc
|
||||
AND components.id_group = comp_group.id_sg
|
||||
|
|
|
@ -709,9 +709,14 @@ function html_print_extended_select_for_time ($name, $selected = '',
|
|||
|
||||
if ( ! $selected ) {
|
||||
foreach( $fields as $t_key => $t_value){
|
||||
if ( $t_key != -1 ) { // -1 means 'custom'
|
||||
$selected = $t_key;
|
||||
break;
|
||||
if ( $t_key != -1 ) {
|
||||
if($nothing == ''){ // -1 means 'custom'
|
||||
$selected = $t_key;
|
||||
break;
|
||||
} else {
|
||||
$selected = $nothing;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -451,6 +451,10 @@ function network_components_create_module_from_network_component ($id_network_co
|
|||
'max_timeout',
|
||||
'max_retries',
|
||||
'history_data',
|
||||
'dynamic_interval',
|
||||
'dynamic_min',
|
||||
'dynamic_max',
|
||||
'dynamic_two_tailed',
|
||||
'min_warning',
|
||||
'max_warning',
|
||||
'str_warning',
|
||||
|
|
|
@ -78,6 +78,10 @@ function configure_modules_form () {
|
|||
$("#checkbox-history_data").check ();
|
||||
$("#text-max").attr ("value", "");
|
||||
$("#text-min").attr ("value", "");
|
||||
$("#dynamic_interval_select").attr ("value", 0);
|
||||
$("#text-dynamic_min").attr ("value", 0);
|
||||
$("#text-dynamic_max").attr ("value", 0);
|
||||
$("#checkbox-dynamic_two_tailed").attr ("value", 0);
|
||||
$("#text-min_warning").attr ("value", 0);
|
||||
$("#text-max_warning").attr ("value", 0);
|
||||
$("#text-str_warning").attr ("value", '');
|
||||
|
@ -134,6 +138,15 @@ function configure_modules_form () {
|
|||
else
|
||||
$("#checkbox-history_data").uncheck ();
|
||||
|
||||
$("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]);
|
||||
$("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]);
|
||||
$("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]);
|
||||
|
||||
if (data["dynamic_two_tailed"])
|
||||
$("#checkbox-dynamic_two_tailed").check ();
|
||||
else
|
||||
$("#checkbox-dynamic_two_tailed").uncheck ();
|
||||
|
||||
$("#text-min_warning").attr ("value", (data["min_warning"] == 0) ? 0 : data["min_warning"]);
|
||||
$("#text-max_warning").attr ("value", (data["max_warning"] == 0) ? 0 : data["max_warning"]);
|
||||
$("#text-str_warning").attr ("value", data["str_warning"]);
|
||||
|
@ -281,6 +294,16 @@ function configure_modules_form () {
|
|||
$("#checkbox-history_data").check ();
|
||||
else
|
||||
$("#checkbox-history_data").uncheck ();
|
||||
|
||||
$("#dynamic_interval_select").attr ("value", (data["dynamic_interval"] == 0) ? 0 : data["dynamic_interval"]);
|
||||
$("#text-dynamic_max").attr ("value", (data["dynamic_max"] == 0) ? 0 : data["dynamic_max"]);
|
||||
$("#text-dynamic_min").attr ("value", (data["dynamic_min"] == 0) ? 0 : data["dynamic_min"]);
|
||||
|
||||
if (data["dynamic_two_tailed"])
|
||||
$("#checkbox-dynamic_two_tailed").check ();
|
||||
else
|
||||
$("#checkbox-dynamic_two_tailed").uncheck ();
|
||||
|
||||
$("#text-min_warning").attr ("value", (data["min_warning"] == 0) ? 0 : data["min_warning"]);
|
||||
$("#text-max_warning").attr ("value", (data["max_warning"] == 0) ? 0 : data["max_warning"]);
|
||||
$("#text-str_warning").attr ("value", data["str_warning"]);
|
||||
|
|
|
@ -3562,3 +3562,7 @@ color:#82b92e;font-family:Nunito;font-size:10pt;position:relative;top:6px;
|
|||
|
||||
|
||||
}
|
||||
|
||||
.readonly{
|
||||
background-color: #dedede !important;
|
||||
}
|
||||
|
|
|
@ -283,6 +283,8 @@ CREATE TABLE tagente_modulo (
|
|||
dynamic_interval INTEGER default 0,
|
||||
dynamic_max INTEGER default 0,
|
||||
dynamic_min INTEGER default 0,
|
||||
dynamic_next INTEGER NOT NULL default 0,
|
||||
dynamic_two_tailed INTEGER default 0,
|
||||
prediction_sample_window INTEGER default 0,
|
||||
prediction_samples INTEGER default 0,
|
||||
prediction_threshold INTEGER default 0,
|
||||
|
@ -861,6 +863,11 @@ CREATE TABLE tnetwork_component (
|
|||
min_ff_event_warning INTEGER DEFAULT 0,
|
||||
min_ff_event_critical INTEGER DEFAULT 0,
|
||||
each_ff NUMBER(1, 0) DEFAULT 0,
|
||||
dynamic_interval INTEGER default 0,
|
||||
dynamic_max INTEGER default 0,
|
||||
dynamic_min INTEGER default 0,
|
||||
dynamic_next INTEGER NOT NULL default 0,
|
||||
dynamic_two_tailed INTEGER default 0,
|
||||
CONSTRAINT t_network_component_wiz_cons CHECK (wizard_level IN ('basic','advanced','nowizard'))
|
||||
);
|
||||
|
||||
|
|
|
@ -245,7 +245,12 @@ CREATE TABLE "tagente_modulo" (
|
|||
"min_ff_event_warning" INTEGER default 0,
|
||||
"min_ff_event_critical" INTEGER default 0,
|
||||
"each_ff" SMALLINT default 0,
|
||||
"ff_timeout" INTEGER default 0
|
||||
"ff_timeout" INTEGER default 0,
|
||||
"dynamic_interval" INTEGER default 0,
|
||||
"dynamic_max" INTEGER default 0,
|
||||
"dynamic_min" INTEGER default 0,
|
||||
"dynamic_next" INTEGER NOT NULL default 0,
|
||||
"dynamic_two_tailed" INTEGER default 0
|
||||
);
|
||||
CREATE INDEX "tagente_modulo_id_agente_idx" ON "tagente_modulo"("id_agente");
|
||||
CREATE INDEX "tagente_modulo_id_tipo_modulo_idx" ON "tagente_modulo"("id_tipo_modulo");
|
||||
|
@ -702,9 +707,14 @@ CREATE TABLE "tnetwork_component" (
|
|||
"disabled_types_event" TEXT default '',
|
||||
"module_macros" TEXT default '',
|
||||
"min_ff_event_normal" INTEGER default 0,
|
||||
"min_ff_event_warning" INTEGER default 0,
|
||||
"min_ff_event_critical" INTEGER default 0,
|
||||
"each_ff" SMALLINT default 0
|
||||
"min_ff_event_warning" INTEGER default 0,
|
||||
"min_ff_event_critical" INTEGER default 0,
|
||||
"each_ff" SMALLINT default 0,
|
||||
"dynamic_interval" INTEGER default 0,
|
||||
"dynamic_max" INTEGER default 0,
|
||||
"dynamic_min" INTEGER default 0,
|
||||
"dynamic_next" INTEGER NOT NULL default 0,
|
||||
"dynamic_two_tailed" INTEGER default 0
|
||||
);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -773,6 +773,11 @@ CREATE TABLE IF NOT EXISTS `tnetwork_component` (
|
|||
`min_ff_event_warning` int(4) unsigned default '0',
|
||||
`min_ff_event_critical` int(4) unsigned default '0',
|
||||
`each_ff` tinyint(1) unsigned default '0',
|
||||
`dynamic_interval` int(4) unsigned default '0',
|
||||
`dynamic_max` int(4) default '0',
|
||||
`dynamic_min` int(4) default '0',
|
||||
`dynamic_next` bigint(20) NOT NULL default '0',
|
||||
`dynamic_two_tailed` tinyint(1) unsigned default '0',
|
||||
PRIMARY KEY (`id_nc`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
Loading…
Reference in New Issue