Added threshold graph to interface monitors graph (Only when monitors have the same warning or critical min value). Ticket #4113
(cherry picked from commit 2391e7ae78
)
Conflicts resolved:
pandora_console/operation/agentes/interface_traffic_graph_win.php
This commit is contained in:
parent
9791f2aacb
commit
fd21b281c7
|
@ -255,7 +255,8 @@ function custom_graphs_print($id_graph, $height, $width, $period,
|
|||
$labels,
|
||||
$dashboard,
|
||||
$vconsole,
|
||||
$percentil);
|
||||
$percentil,
|
||||
$from_interface);
|
||||
|
||||
if ($return)
|
||||
return $output;
|
||||
|
|
|
@ -973,7 +973,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
$prediction_period = false, $background_color = 'white',
|
||||
$name_list = array(), $unit_list = array(), $show_last = true, $show_max = true,
|
||||
$show_min = true, $show_avg = true, $labels = array(), $dashboard = false,
|
||||
$vconsole = false, $percentil = null) {
|
||||
$vconsole = false, $percentil = null, $from_interface = false) {
|
||||
|
||||
global $config;
|
||||
global $graphic_type;
|
||||
|
@ -1707,6 +1707,44 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
'color' => COL_GRAPH13,
|
||||
'alpha' => CHART_DEFAULT_ALPHA);
|
||||
|
||||
$yellow_threshold = 0;
|
||||
$red_threshold = 0;
|
||||
if ($from_interface) {
|
||||
$compare_warning = 0;
|
||||
$compare_critical = 0;
|
||||
$do_it_warning = true;
|
||||
$do_it_critical = true;
|
||||
foreach ($module_list as $id_module) {
|
||||
// Get module warning_min and critical_min
|
||||
$warning_min = db_get_value('min_warning','tagente_modulo','id_agente_modulo',$id_module);
|
||||
$critical_min = db_get_value('min_critical','tagente_modulo','id_agente_modulo',$id_module);
|
||||
if ($compare_warning == 0) {
|
||||
$compare_warning = $warning_min;
|
||||
}
|
||||
else {
|
||||
if ($compare_warning != $warning_min) {
|
||||
$do_it_warning = false;
|
||||
}
|
||||
}
|
||||
if ($compare_critical == 0) {
|
||||
$compare_critical = $critical_min;
|
||||
}
|
||||
else {
|
||||
if ($compare_warning != $warning_min) {
|
||||
$do_it_critical = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($do_it_warning) {
|
||||
$yellow_threshold = $compare_warning;
|
||||
}
|
||||
|
||||
if ($do_it_critical) {
|
||||
$red_threshold = $compare_critical;
|
||||
}
|
||||
}
|
||||
|
||||
switch ($stacked) {
|
||||
case CUSTOM_GRAPH_AREA:
|
||||
return area_graph($flash_charts, $graph_values, $width,
|
||||
|
@ -1730,7 +1768,7 @@ function graphic_combined_module ($module_list, $weight_list, $period,
|
|||
ui_get_full_url("images/image_problem.opaque.png", false, false, false),
|
||||
$title, "", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||
$unit, $ttl, $homeurl, $background_color, $dashboard,
|
||||
$vconsole, $series_type, $percentil_result);
|
||||
$vconsole, $series_type, $percentil_result, $yellow_threshold, $red_threshold);
|
||||
break;
|
||||
case CUSTOM_GRAPH_STACKED_LINE:
|
||||
return stacked_line_graph($flash_charts, $graph_values,
|
||||
|
|
|
@ -511,7 +511,7 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||
$yaxisname = "", $water_mark = "", $font = '', $font_size = '',
|
||||
$unit = '', $ttl = 1, $homeurl = '', $backgroundColor = 'white',
|
||||
$dashboard = false, $vconsole = false, $series_type = array(),
|
||||
$percentil_values = array()) {
|
||||
$percentil_values = array(), $yellow_threshold = 0, $red_threshold = 0) {
|
||||
|
||||
include_once("functions_flot.php");
|
||||
|
||||
|
@ -538,8 +538,8 @@ function line_graph($flash_chart, $chart_data, $width, $height, $color,
|
|||
$water_mark_url,
|
||||
$series_type,
|
||||
array(),
|
||||
0,
|
||||
0,
|
||||
$yellow_threshold,
|
||||
$red_threshold,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
|
|
Loading…
Reference in New Issue