Merge branch 'ent-8222-Nueva-grafica-desde-la-vista-de-modulos-Histograma' into 'develop'
Ent 8222 nueva grafica desde la vista de modulos histograma See merge request artica/pandorafms!4637
This commit is contained in:
commit
4b85e93490
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 933 B |
|
@ -1189,14 +1189,25 @@ if (check_login()) {
|
|||
|
||||
$data[8] = ' ';
|
||||
if ($module['history_data'] == 1) {
|
||||
$tresholds = true;
|
||||
if (empty((float) $module['min_warning']) === true
|
||||
&& empty((float) $module['max_warning']) === true
|
||||
&& empty($module['warning_inverse']) === true
|
||||
&& empty((float) $module['min_critical']) === true
|
||||
&& empty((float) $module['max_critical']) === true
|
||||
&& empty($module['critical_inverse']) === true
|
||||
) {
|
||||
$tresholds = false;
|
||||
}
|
||||
|
||||
$nombre_tipo_modulo = modules_get_moduletype_name($module['id_tipo_modulo']);
|
||||
$handle = 'stat'.$nombre_tipo_modulo.'_'.$module['id_agente_modulo'];
|
||||
$url = 'include/procesos.php?agente='.$module['id_agente_modulo'];
|
||||
$win_handle = dechex(crc32($module['id_agente_modulo'].$module['nombre']));
|
||||
|
||||
// Try to display the SNMP module realtime graph
|
||||
// Try to display the SNMP module realtime graph.
|
||||
$rt_button = get_module_realtime_link_graph($module);
|
||||
if (!empty($rt_button)) {
|
||||
if (empty($rt_button) === false) {
|
||||
$data[8] = $rt_button.' ';
|
||||
}
|
||||
|
||||
|
@ -1207,6 +1218,19 @@ if (check_login()) {
|
|||
$draw_events = 0;
|
||||
}
|
||||
|
||||
if ($tresholds === true || $graph_type === 'boolean') {
|
||||
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&refresh='.SECONDS_10MINUTES.'&'."histogram=1', 'day_".$win_handle."', 800, 480)";
|
||||
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image(
|
||||
'images/histograma.png',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'alt' => '',
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a> ';
|
||||
}
|
||||
|
||||
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&".'period='.SECONDS_1DAY.'&id='.$module['id_agente_modulo'].'&refresh='.SECONDS_10MINUTES.'&'."draw_events=$draw_events', 'day_".$win_handle."', 800, 480)";
|
||||
if (!is_snapshot_data($module['datos'])) {
|
||||
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image(
|
||||
|
@ -1349,13 +1373,34 @@ if (check_login()) {
|
|||
metaconsole_connect($server);
|
||||
}
|
||||
|
||||
$output .= grafico_modulo_sparse($params);
|
||||
echo $output;
|
||||
if ($params['histogram'] === true) {
|
||||
$params['id_agent_module'] = $params['agent_module_id'];
|
||||
$params['dinamic_proc'] = 1;
|
||||
|
||||
$output .= '<div class="stat_win_histogram">';
|
||||
if ($params['compare'] === 'separated') {
|
||||
$graph = \reporting_module_histogram_graph(
|
||||
['datetime' => ($params['begin_date'] - $params['period'])],
|
||||
$params
|
||||
);
|
||||
$output .= $graph['chart'];
|
||||
}
|
||||
|
||||
$graph = \reporting_module_histogram_graph(
|
||||
['datetime' => $params['begin_date']],
|
||||
$params
|
||||
);
|
||||
$output .= $graph['chart'];
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= grafico_modulo_sparse($params);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true && empty($server_id) === false) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
echo $output;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -669,15 +669,20 @@ class Tree
|
|||
// HTML of the server type image
|
||||
$module['serverTypeHTML'] = servers_show_type($module['server_type']);
|
||||
|
||||
// Link to the Module graph
|
||||
// ACL
|
||||
// Link to the Module graph.
|
||||
// ACL.
|
||||
$acl_graphs = false;
|
||||
$module['showGraphs'] = 0;
|
||||
|
||||
// Avoid the check on the metaconsole. Too slow to show/hide an icon depending on the permissions
|
||||
if (!empty($group_id) && !is_metaconsole()) {
|
||||
$acl_graphs = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR');
|
||||
} else if (!empty($all_groups)) {
|
||||
// Avoid the check on the metaconsole.
|
||||
// Too slow to show/hide an icon depending on the permissions.
|
||||
if (empty($group_id) === false && is_metaconsole() === false) {
|
||||
$acl_graphs = check_acl_one_of_groups(
|
||||
$config['id_user'],
|
||||
$all_groups,
|
||||
'RR'
|
||||
);
|
||||
} else if (empty($all_groups) === false) {
|
||||
$acl_graphs = true;
|
||||
}
|
||||
|
||||
|
@ -686,8 +691,24 @@ class Tree
|
|||
}
|
||||
|
||||
if ($module['showGraphs']) {
|
||||
$tresholds = true;
|
||||
if (empty((float) $module['min_warning']) === true
|
||||
&& empty((float) $module['max_warning']) === true
|
||||
&& empty($module['warning_inverse']) === true
|
||||
&& empty((float) $module['min_critical']) === true
|
||||
&& empty((float) $module['max_critical']) === true
|
||||
&& empty($module['critical_inverse']) === true
|
||||
) {
|
||||
$tresholds = false;
|
||||
}
|
||||
|
||||
$graphType = return_graphtype($module['id_module_type']);
|
||||
$url = ui_get_full_url('operation/agentes/stat_win.php', false, false, false);
|
||||
$url = ui_get_full_url(
|
||||
'operation/agentes/stat_win.php',
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$winHandle = dechex(crc32($module['id'].$module['name']));
|
||||
|
||||
$graph_params = [
|
||||
|
@ -697,20 +718,20 @@ class Tree
|
|||
'refresh' => SECONDS_10MINUTES,
|
||||
];
|
||||
|
||||
if (is_metaconsole()) {
|
||||
// Set the server id
|
||||
if (is_metaconsole() === true) {
|
||||
// Set the server id.
|
||||
$graph_params['server'] = $module['serverID'];
|
||||
}
|
||||
|
||||
$graph_params_str = http_build_query($graph_params);
|
||||
$moduleGraphURL = "$url?$graph_params_str";
|
||||
$moduleGraphURL = $url.'?'.$graph_params_str;
|
||||
|
||||
$module['moduleGraph'] = [
|
||||
'url' => $moduleGraphURL,
|
||||
'handle' => $winHandle,
|
||||
];
|
||||
|
||||
// Info to be able to open the snapshot image new page
|
||||
// Info to be able to open the snapshot image new page.
|
||||
$module['snapshot'] = ui_get_snapshot_link(
|
||||
[
|
||||
'id_module' => $module['id'],
|
||||
|
@ -720,6 +741,16 @@ class Tree
|
|||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($tresholds === true || $graphType === 'boolean') {
|
||||
$graph_params['histogram'] = 1;
|
||||
$graph_params_str_th = http_build_query($graph_params);
|
||||
$moduleGraphURLTh = $url.'?'.$graph_params_str_th;
|
||||
$module['histogramGraph'] = [
|
||||
'url' => $moduleGraphURLTh,
|
||||
'handle' => $winHandle,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$module_alerts = alerts_get_alerts_agent_module($module['id']);
|
||||
|
|
|
@ -982,31 +982,31 @@ function groups_get_agents_counter($group, $agent_filter=[], $module_filter=[],
|
|||
switch ($agent_status) {
|
||||
case AGENT_STATUS_CRITICAL:
|
||||
if ($critical > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_WARNING:
|
||||
if (($total > 0) && ($critical == 0) && ($warning > 0)) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_UNKNOWN:
|
||||
if ($critical == 0 && $warning == 0 && $unknown > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NOT_INIT:
|
||||
if ($total == 0 || $total == $not_init) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NORMAL:
|
||||
if ($critical == 0 && $warning == 0 && $unknown == 0 && $normal > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1017,23 +1017,23 @@ function groups_get_agents_counter($group, $agent_filter=[], $module_filter=[],
|
|||
} else {
|
||||
if (array_search(AGENT_STATUS_CRITICAL, $agent_status) !== false) {
|
||||
if ($critical > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_WARNING, $agent_status) !== false) {
|
||||
if ($total > 0 && $critical = 0 && $warning > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_UNKNOWN, $agent_status) !== false) {
|
||||
if ($critical == 0 && $warning == 0 && $unknown > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_NOT_INIT, $agent_status) !== false) {
|
||||
if ($total == 0 || $total == $not_init) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_NORMAL, $agent_status) !== false) {
|
||||
if ($critical == 0 && $warning == 0 && $unknown == 0 && $normal > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
// Invalid status
|
||||
|
|
|
@ -14165,7 +14165,7 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
|
|||
if (modules_is_disable_agent($content['id_agent_module'])
|
||||
|| modules_is_not_init($content['id_agent_module'])
|
||||
) {
|
||||
if ($metaconsole_on) {
|
||||
if ($metaconsole_on && $server_name != '') {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
@ -14189,6 +14189,9 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
|
|||
if ($modules_is_string === false) {
|
||||
if ($agentmodule_info['max_critical'] == 0) {
|
||||
$max_value_critical = null;
|
||||
if ((bool) $content['dinamic_proc'] === true) {
|
||||
$max_value_critical = 0.01;
|
||||
}
|
||||
} else {
|
||||
$max_value_critical = $agentmodule_info['max_critical'];
|
||||
}
|
||||
|
@ -14396,28 +14399,37 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
|
|||
|
||||
$width_graph = 100;
|
||||
$height_graph = 80;
|
||||
$return['chart'] = flot_slicesbar_graph(
|
||||
$array_result,
|
||||
$time_total,
|
||||
$width_graph,
|
||||
$height_graph,
|
||||
$legend,
|
||||
$colors,
|
||||
$config['fontpath'],
|
||||
$config['round_corner'],
|
||||
$homeurl,
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
[],
|
||||
true,
|
||||
$ttl,
|
||||
$content['sizeForTicks'],
|
||||
true
|
||||
);
|
||||
if (empty($array_result) === false) {
|
||||
$return['chart'] = flot_slicesbar_graph(
|
||||
$array_result,
|
||||
$time_total,
|
||||
$width_graph,
|
||||
$height_graph,
|
||||
$legend,
|
||||
$colors,
|
||||
$config['fontpath'],
|
||||
$config['round_corner'],
|
||||
$homeurl,
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
[],
|
||||
true,
|
||||
$ttl,
|
||||
$content['sizeForTicks'],
|
||||
true,
|
||||
$report['datetime']
|
||||
);
|
||||
} else {
|
||||
$return['chart'] = graph_nodata_image(
|
||||
$width_graph,
|
||||
$height_graph,
|
||||
'area'
|
||||
);
|
||||
}
|
||||
|
||||
if ($metaconsole_on) {
|
||||
if ($metaconsole_on && $server_name != '') {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
|
|
@ -1627,31 +1627,31 @@ function tags_get_agents_counter($id_tag, $groups_and_tags=[], $agent_filter=[],
|
|||
switch ($agent_status) {
|
||||
case AGENT_STATUS_CRITICAL:
|
||||
if ($critical > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_WARNING:
|
||||
if ($total > 0 && $critical = 0 && $warning > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_UNKNOWN:
|
||||
if ($critical == 0 && $warning == 0 && $unknown > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NOT_INIT:
|
||||
if ($total == 0 || $total == $not_init) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NORMAL:
|
||||
if ($critical == 0 && $warning == 0 && $unknown == 0 && $normal > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1662,23 +1662,23 @@ function tags_get_agents_counter($id_tag, $groups_and_tags=[], $agent_filter=[],
|
|||
} else {
|
||||
if (array_search(AGENT_STATUS_CRITICAL, $agent_status) !== false) {
|
||||
if ($critical > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_WARNING, $agent_status) !== false) {
|
||||
if ($total > 0 && $critical = 0 && $warning > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_UNKNOWN, $agent_status) !== false) {
|
||||
if ($critical == 0 && $warning == 0 && $unknown > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_NOT_INIT, $agent_status) !== false) {
|
||||
if ($total == 0 || $total == $not_init) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
} else if (array_search(AGENT_STATUS_NORMAL, $agent_status) !== false) {
|
||||
if ($critical == 0 && $warning == 0 && $unknown == 0 && $normal > 0) {
|
||||
$count ++;
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
// Invalid status.
|
||||
|
|
|
@ -990,6 +990,35 @@ var TreeController = {
|
|||
typeof element.showGraphs != "undefined" &&
|
||||
element.showGraphs != 0
|
||||
) {
|
||||
// Graph histogram pop-up
|
||||
if (typeof element.histogramGraph != "undefined") {
|
||||
var graphImageHistogram = $(
|
||||
'<img src="' +
|
||||
(controller.baseURL.length > 0
|
||||
? controller.baseURL
|
||||
: "") +
|
||||
'images/histograma.png" /> '
|
||||
);
|
||||
|
||||
graphImageHistogram
|
||||
.addClass("module-graph")
|
||||
.click(function(e) {
|
||||
e.stopPropagation();
|
||||
try {
|
||||
winopeng_var(
|
||||
element.histogramGraph.url,
|
||||
element.histogramGraph.handle,
|
||||
800,
|
||||
480
|
||||
);
|
||||
} catch (error) {
|
||||
// console.log(error);
|
||||
}
|
||||
});
|
||||
|
||||
$content.append(graphImageHistogram);
|
||||
}
|
||||
|
||||
// Graph pop-up
|
||||
if (typeof element.moduleGraph != "undefined") {
|
||||
if (element.statusImageHTML.indexOf("data:image") != -1) {
|
||||
|
|
|
@ -378,6 +378,8 @@ class GraphModuleHistogramWidget extends Widget
|
|||
|
||||
$size = parent::getSize();
|
||||
|
||||
$output = '';
|
||||
|
||||
// Desactive scroll bars only this item.
|
||||
$id_agent = $this->values['agentId'];
|
||||
$id_module = $this->values['moduleId'];
|
||||
|
|
|
@ -8435,6 +8435,16 @@ div.stat-win-spinner img {
|
|||
font-size: 12px;
|
||||
}
|
||||
|
||||
.stat_win_histogram {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
margin-top: 18%;
|
||||
}
|
||||
|
||||
#stat-win-module-graph .stat_win_histogram div.nodata_container {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* For backups dt, can be useful for others */
|
||||
#backups_list > thead > tr > th:last-child,
|
||||
#backups_list > tbody > tr > td:last-child {
|
||||
|
|
|
@ -194,60 +194,7 @@ ui_print_message_dialog(
|
|||
$time_compare_separated = get_parameter('time_compare_separated', 0);
|
||||
$time_compare_overlapped = get_parameter('time_compare_overlapped', 0);
|
||||
$unknown_graph = get_parameter_checkbox('unknown_graph', 1);
|
||||
|
||||
$fullscale_sent = get_parameter('fullscale_sent', 0);
|
||||
if (!$fullscale_sent) {
|
||||
if (isset($config['full_scale_option']) === false
|
||||
|| $config['full_scale_option'] == 0
|
||||
) {
|
||||
$fullscale = 0;
|
||||
} else if ($config['full_scale_option'] == 1) {
|
||||
$fullscale = 1;
|
||||
} else if ($config['full_scale_option'] == 2) {
|
||||
if ($graph_type == 'boolean') {
|
||||
$fullscale = 1;
|
||||
} else {
|
||||
$fullscale = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$fullscale = get_parameter('fullscale', 0);
|
||||
}
|
||||
|
||||
$type_mode_graph = get_parameter_checkbox(
|
||||
'type_mode_graph',
|
||||
($fullscale === 1) ? 0 : $config['type_mode_graph']
|
||||
);
|
||||
|
||||
$time_compare = false;
|
||||
|
||||
if ($time_compare_separated) {
|
||||
$time_compare = 'separated';
|
||||
} else if ($time_compare_overlapped) {
|
||||
$time_compare = 'overlapped';
|
||||
}
|
||||
|
||||
if ($zoom > 1) {
|
||||
$height = ($height * ($zoom / 2.1));
|
||||
$width = ($width * ($zoom / 1.4));
|
||||
}
|
||||
|
||||
// Build date.
|
||||
$date = strtotime($start_date.' '.$start_time);
|
||||
$now = time();
|
||||
|
||||
if ($date > $now) {
|
||||
$date = $now;
|
||||
}
|
||||
|
||||
$urlImage = ui_get_full_url(false, false, false, false);
|
||||
|
||||
$unit = db_get_value(
|
||||
'unit',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$id
|
||||
);
|
||||
$histogram = (bool) get_parameter('histogram', 0);
|
||||
|
||||
// FORM TABLE.
|
||||
$table = html_get_predefined_table('transparent', 2);
|
||||
|
@ -258,162 +205,257 @@ ui_print_message_dialog(
|
|||
$table->style[2] = 'text-align:left;font-weight: bold;';
|
||||
$table->style[3] = 'text-align:left;';
|
||||
$table->class = 'table_modal_alternate';
|
||||
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Refresh time');
|
||||
$table->data[0][1] = html_print_extended_select_for_time(
|
||||
'refresh',
|
||||
$refresh,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
7,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[0][2] = __('Show events');
|
||||
$disabled = false;
|
||||
if (isset($config['event_replication']) === true) {
|
||||
if ($config['event_replication']
|
||||
&& !$config['show_events_in_local']
|
||||
) {
|
||||
$disabled = true;
|
||||
$time_compare = false;
|
||||
|
||||
if ($time_compare_separated) {
|
||||
$time_compare = 'separated';
|
||||
} else if ($time_compare_overlapped) {
|
||||
$time_compare = 'overlapped';
|
||||
}
|
||||
|
||||
if ($histogram === false) {
|
||||
$fullscale_sent = get_parameter('fullscale_sent', 0);
|
||||
if (!$fullscale_sent) {
|
||||
if (isset($config['full_scale_option']) === false
|
||||
|| $config['full_scale_option'] == 0
|
||||
) {
|
||||
$fullscale = 0;
|
||||
} else if ($config['full_scale_option'] == 1) {
|
||||
$fullscale = 1;
|
||||
} else if ($config['full_scale_option'] == 2) {
|
||||
if ($graph_type == 'boolean') {
|
||||
$fullscale = 1;
|
||||
} else {
|
||||
$fullscale = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$fullscale = get_parameter('fullscale', 0);
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[0][3] = html_print_checkbox_switch(
|
||||
'draw_events',
|
||||
1,
|
||||
(bool) $draw_events,
|
||||
true,
|
||||
$disabled
|
||||
);
|
||||
if ($disabled) {
|
||||
$table->data[1] .= ui_print_help_tip(
|
||||
__("'Show events' is disabled because this %s node is set to event replication.", get_product_name()),
|
||||
true
|
||||
$type_mode_graph = get_parameter_checkbox(
|
||||
'type_mode_graph',
|
||||
($fullscale === 1) ? 0 : $config['type_mode_graph']
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Begin date');
|
||||
$table->data[1][1] = html_print_input_text(
|
||||
'start_date',
|
||||
$start_date,
|
||||
'',
|
||||
10,
|
||||
20,
|
||||
true
|
||||
);
|
||||
if ($zoom > 1) {
|
||||
$height = ($height * ($zoom / 2.1));
|
||||
$width = ($width * ($zoom / 1.4));
|
||||
}
|
||||
|
||||
$table->data[1][2] = __('Show alerts');
|
||||
$table->data[1][3] = html_print_checkbox_switch(
|
||||
'draw_alerts',
|
||||
1,
|
||||
(bool) $draw_alerts,
|
||||
true
|
||||
);
|
||||
// Build date.
|
||||
$date = strtotime($start_date.' '.$start_time);
|
||||
$now = time();
|
||||
|
||||
$table->data[2][0] = __('Begin time');
|
||||
$table->data[2][1] = html_print_input_text(
|
||||
'start_time',
|
||||
$start_time,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
);
|
||||
if ($date > $now) {
|
||||
$date = $now;
|
||||
}
|
||||
|
||||
$table->data[2][2] = __('Show unknown graph');
|
||||
$table->data[2][3] = html_print_checkbox_switch(
|
||||
'unknown_graph',
|
||||
1,
|
||||
(bool) $unknown_graph,
|
||||
true
|
||||
);
|
||||
$urlImage = ui_get_full_url(false, false, false, false);
|
||||
|
||||
$table->data[3][0] = __('Time range');
|
||||
$table->data[3][1] = html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
7,
|
||||
true
|
||||
);
|
||||
$unit = db_get_value(
|
||||
'unit',
|
||||
'tagente_modulo',
|
||||
'id_agente_modulo',
|
||||
$id
|
||||
);
|
||||
|
||||
$table->data[3][2] = '';
|
||||
$table->data[3][3] = '';
|
||||
|
||||
if (!modules_is_boolean($id)) {
|
||||
$table->data[4][0] = __('Zoom');
|
||||
$options = [];
|
||||
$options[$zoom] = 'x'.$zoom;
|
||||
$options[1] = 'x1';
|
||||
$options[2] = 'x2';
|
||||
$options[3] = 'x3';
|
||||
$options[4] = 'x4';
|
||||
$options[5] = 'x5';
|
||||
$table->data[4][1] = html_print_select(
|
||||
$options,
|
||||
'zoom',
|
||||
$zoom,
|
||||
$table->data[0][0] = __('Refresh time');
|
||||
$table->data[0][1] = html_print_extended_select_for_time(
|
||||
'refresh',
|
||||
$refresh,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
7,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[0][2] = __('Show events');
|
||||
$disabled = false;
|
||||
if (isset($config['event_replication']) === true) {
|
||||
if ($config['event_replication']
|
||||
&& !$config['show_events_in_local']
|
||||
) {
|
||||
$disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
$table->data[0][3] = html_print_checkbox_switch(
|
||||
'draw_events',
|
||||
1,
|
||||
(bool) $draw_events,
|
||||
true,
|
||||
$disabled
|
||||
);
|
||||
if ($disabled) {
|
||||
$table->data[1] .= ui_print_help_tip(
|
||||
__("'Show events' is disabled because this %s node is set to event replication.", get_product_name()),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Begin date');
|
||||
$table->data[1][1] = html_print_input_text(
|
||||
'start_date',
|
||||
$start_date,
|
||||
'',
|
||||
10,
|
||||
20,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][2] = __('Show alerts');
|
||||
$table->data[1][3] = html_print_checkbox_switch(
|
||||
'draw_alerts',
|
||||
1,
|
||||
(bool) $draw_alerts,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Begin time');
|
||||
$table->data[2][1] = html_print_input_text(
|
||||
'start_time',
|
||||
$start_time,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[2][2] = __('Show unknown graph');
|
||||
$table->data[2][3] = html_print_checkbox_switch(
|
||||
'unknown_graph',
|
||||
1,
|
||||
(bool) $unknown_graph,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[3][0] = __('Time range');
|
||||
$table->data[3][1] = html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
7,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[3][2] = '';
|
||||
$table->data[3][3] = '';
|
||||
|
||||
if (!modules_is_boolean($id)) {
|
||||
$table->data[4][0] = __('Zoom');
|
||||
$options = [];
|
||||
$options[$zoom] = 'x'.$zoom;
|
||||
$options[1] = 'x1';
|
||||
$options[2] = 'x2';
|
||||
$options[3] = 'x3';
|
||||
$options[4] = 'x4';
|
||||
$options[5] = 'x5';
|
||||
$table->data[4][1] = html_print_select(
|
||||
$options,
|
||||
'zoom',
|
||||
$zoom,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$table->data[4][2] = __('Show percentil');
|
||||
$table->data[4][3] = html_print_checkbox_switch(
|
||||
'show_percentil',
|
||||
1,
|
||||
(bool) $show_percentil,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[5][0] = __('Time compare (Overlapped)');
|
||||
$table->data[5][1] = html_print_checkbox_switch(
|
||||
'time_compare_overlapped',
|
||||
1,
|
||||
(bool) $time_compare_overlapped,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[5][2] = __('Time compare (Separated)');
|
||||
$table->data[5][3] = html_print_checkbox_switch(
|
||||
'time_compare_separated',
|
||||
1,
|
||||
(bool) $time_compare_separated,
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
$table->data[6][0] = __('Show AVG/MAX/MIN data series in graph');
|
||||
$table->data[6][1] = html_print_checkbox_switch(
|
||||
'type_mode_graph',
|
||||
1,
|
||||
(bool) $type_mode_graph,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$table->data[4][2] = __('Show percentil');
|
||||
$table->data[4][3] = html_print_checkbox_switch(
|
||||
'show_percentil',
|
||||
$table->data[6][2] = __('Show full scale graph (TIP)');
|
||||
$table->data[6][2] .= ui_print_help_tip(
|
||||
__('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
|
||||
true
|
||||
);
|
||||
$table->data[6][3] = html_print_checkbox_switch(
|
||||
'fullscale',
|
||||
1,
|
||||
(bool) $show_percentil,
|
||||
(bool) $fullscale,
|
||||
true,
|
||||
false
|
||||
);
|
||||
} else {
|
||||
$table->data[0][0] = __('Begin date');
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'start_date',
|
||||
$start_date,
|
||||
'',
|
||||
10,
|
||||
20,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[0][2] = __('Begin time');
|
||||
$table->data[0][3] = html_print_input_text(
|
||||
'start_time',
|
||||
$start_time,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][0] = __('Time range');
|
||||
$table->data[1][1] = html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
7,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][2] = __('Time compare (Separated)');
|
||||
$table->data[1][3] = html_print_checkbox_switch(
|
||||
'time_compare_separated',
|
||||
1,
|
||||
(bool) $time_compare_separated,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[5][0] = __('Time compare (Overlapped)');
|
||||
$table->data[5][1] = html_print_checkbox_switch(
|
||||
'time_compare_overlapped',
|
||||
1,
|
||||
(bool) $time_compare_overlapped,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[5][2] = __('Time compare (Separated)');
|
||||
$table->data[5][3] = html_print_checkbox_switch(
|
||||
'time_compare_separated',
|
||||
1,
|
||||
(bool) $time_compare_separated,
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
$table->data[6][0] = __('Show AVG/MAX/MIN data series in graph');
|
||||
$table->data[6][1] = html_print_checkbox_switch(
|
||||
'type_mode_graph',
|
||||
1,
|
||||
(bool) $type_mode_graph,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$table->data[6][2] = __('Show full scale graph (TIP)');
|
||||
$table->data[6][2] .= ui_print_help_tip(
|
||||
__('TIP mode charts do not support average - maximum - minimum series, you can only enable TIP or average, maximum or minimum series'),
|
||||
true
|
||||
);
|
||||
$table->data[6][3] = html_print_checkbox_switch(
|
||||
'fullscale',
|
||||
1,
|
||||
(bool) $fullscale,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$form_table = html_print_table($table, true);
|
||||
$form_table .= '<div class="w100p right mrgn_top_15px right_align">';
|
||||
$form_table .= html_print_submit_button(
|
||||
|
@ -434,6 +476,8 @@ ui_print_message_dialog(
|
|||
$menu_form .= html_print_input_hidden('server', $server_id, true);
|
||||
}
|
||||
|
||||
$menu_form .= html_print_input_hidden('histogram', $histogram, true);
|
||||
|
||||
if (isset($_GET['type']) === true) {
|
||||
$type = get_parameter_get('type');
|
||||
$menu_form .= html_print_input_hidden('type', $type, true);
|
||||
|
@ -460,7 +504,13 @@ ui_print_message_dialog(
|
|||
);
|
||||
$menu_form .= '</span>';
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '<div class="module_graph_menu_content module_graph_menu_content_closed invisible">';
|
||||
|
||||
$class = 'module_graph_menu_content';
|
||||
if ($histogram === false) {
|
||||
$class .= ' module_graph_menu_content_closed invisible';
|
||||
}
|
||||
|
||||
$menu_form .= '<div class="'.$class.'">';
|
||||
$menu_form .= $form_table;
|
||||
$menu_form .= '</div>';
|
||||
$menu_form .= '</div>';
|
||||
|
@ -497,6 +547,8 @@ ui_print_message_dialog(
|
|||
'zoom' => $zoom,
|
||||
'height' => 300,
|
||||
'type_mode_graph' => $type_mode_graph,
|
||||
'histogram' => $histogram,
|
||||
'begin_date' => strtotime($start_date.' '.$start_time),
|
||||
];
|
||||
|
||||
// Graph.
|
||||
|
|
|
@ -1725,6 +1725,17 @@ $table->data[4][0] .= __('Not condition').' '.ui_print_help_tip(__('If you
|
|||
}
|
||||
|
||||
if ($row['history_data'] == 1 && $acl_graphs) {
|
||||
$tresholds = true;
|
||||
if (empty((float) $module['min_warning']) === true
|
||||
&& empty((float) $module['max_warning']) === true
|
||||
&& empty($module['warning_inverse']) === true
|
||||
&& empty((float) $module['min_critical']) === true
|
||||
&& empty((float) $module['max_critical']) === true
|
||||
&& empty($module['critical_inverse']) === true
|
||||
) {
|
||||
$tresholds = false;
|
||||
}
|
||||
|
||||
$graph_type = return_graphtype($row['module_type']);
|
||||
|
||||
$url = ui_get_full_url('operation/agentes/stat_win.php', false, false, false);
|
||||
|
@ -1738,6 +1749,10 @@ $table->data[4][0] .= __('Not condition').' '.ui_print_help_tip(__('If you
|
|||
'refresh' => SECONDS_10MINUTES,
|
||||
];
|
||||
|
||||
if ($tresholds === true || $graph_type === 'boolean') {
|
||||
$graph_params['histogram'] = 1;
|
||||
}
|
||||
|
||||
if (is_metaconsole() && isset($row['server_id'])) {
|
||||
// Set the server id.
|
||||
$graph_params['server'] = $row['server_id'];
|
||||
|
@ -1749,6 +1764,18 @@ $table->data[4][0] .= __('Not condition').' '.ui_print_help_tip(__('If you
|
|||
|
||||
$data[8] = get_module_realtime_link_graph($row);
|
||||
|
||||
if ($tresholds === true || $graph_type === 'boolean') {
|
||||
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image(
|
||||
'images/histograma.png',
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'alt' => '',
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
}
|
||||
|
||||
if (!is_snapshot_data($row['datos'])) {
|
||||
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart.png', true, ['border' => '0', 'alt' => '', 'class' => 'invert_filter']).'</a>';
|
||||
}
|
||||
|
|
|
@ -556,13 +556,13 @@ $table_ichanges = '<div class="autorefresh_select">
|
|||
</div>
|
||||
<div class="autorefresh_select_arrows" style="display:grid">
|
||||
<a href="javascript:">'.html_print_image(
|
||||
'images/darrowright_green.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'right_autorefreshlist',
|
||||
'alt' => __('Push selected pages into autorefresh list'),
|
||||
'title' => __('Push selected pages into autorefresh list'),
|
||||
]
|
||||
'images/darrowright_green.png',
|
||||
true,
|
||||
[
|
||||
'id' => 'right_autorefreshlist',
|
||||
'alt' => __('Push selected pages into autorefresh list'),
|
||||
'title' => __('Push selected pages into autorefresh list'),
|
||||
]
|
||||
).'</a>
|
||||
<a href="javascript:">'.html_print_image(
|
||||
'images/darrowleft_green.png',
|
||||
|
|
Loading…
Reference in New Issue