2013-02-14 Miguel de Dios <miguel.dedios@artica.es>
* godmode/massive/massive_operations.php, godmode/massive/massive_enable_disable_alerts.php, godmode/massive/massive_standby_alerts.php, godmode/tag/edit_tag.php, include/functions_graph.php, include/functions_io.php, include/functions_ui.php: cleaned source code style. * include/functions_modules.php: erased deprecated function "modules_give_modulecategory_name". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7648 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
5855f5895d
commit
6658fe31a3
|
@ -1,3 +1,15 @@
|
|||
2013-02-14 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* godmode/massive/massive_operations.php,
|
||||
godmode/massive/massive_enable_disable_alerts.php,
|
||||
godmode/massive/massive_standby_alerts.php,
|
||||
godmode/tag/edit_tag.php, include/functions_graph.php,
|
||||
include/functions_io.php, include/functions_ui.php: cleaned source
|
||||
code style.
|
||||
|
||||
* include/functions_modules.php: erased deprecated function
|
||||
"modules_give_modulecategory_name".
|
||||
|
||||
2013-02-13 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* extensions/module_groups.php,
|
||||
|
|
|
@ -67,7 +67,7 @@ $recursion = get_parameter ('recursion');
|
|||
|
||||
$result = false;
|
||||
|
||||
switch($action) {
|
||||
switch ($action) {
|
||||
case 'enable_alerts':
|
||||
$id_alert_templates = (int) get_parameter ('id_alert_template_disabled', 0);
|
||||
$id_disabled_alerts = get_parameter_post ('id_disabled_alerts', array());
|
||||
|
|
|
@ -440,10 +440,10 @@ function grafico_modulo_sparse_data_chart (&$chart, &$chart_data_extra, &$long_i
|
|||
}
|
||||
}*/
|
||||
|
||||
if(!empty($event_ids)) {
|
||||
if (!empty($event_ids)) {
|
||||
$chart_extra_data[count($chart)-1]['events'] = implode(',',$event_ids);
|
||||
}
|
||||
if(!empty($alert_ids)) {
|
||||
if (!empty($alert_ids)) {
|
||||
$chart_extra_data[count($chart)-1]['alerts'] = implode(',',$alert_ids);
|
||||
}
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ function grafico_modulo_sparse_data ($agent_module_id, $period, $show_events,
|
|||
array ('id_agentmodule' => $agent_module_id,
|
||||
"utimestamp <= $datelimit",
|
||||
'order' => 'utimestamp DESC'));
|
||||
if(isset($prev_event['event_type']) && $prev_event['event_type'] == 'going_unknown') {
|
||||
if (isset($prev_event['event_type']) && $prev_event['event_type'] == 'going_unknown') {
|
||||
$start_unknown = true;
|
||||
}
|
||||
|
||||
|
@ -749,10 +749,10 @@ function grafico_modulo_sparse ($agent_module_id, $period, $show_events,
|
|||
return $data_returned;
|
||||
}
|
||||
|
||||
if($compare === 'overlapped') {
|
||||
if ($compare === 'overlapped') {
|
||||
$i = 0;
|
||||
foreach($chart as $k=>$v) {
|
||||
if(!isset($chart_prev[$i])) {
|
||||
foreach ($chart as $k=>$v) {
|
||||
if (!isset($chart_prev[$i])) {
|
||||
continue;
|
||||
}
|
||||
$chart[$k] = array_merge($v,$chart_prev[$i]);
|
||||
|
@ -1218,34 +1218,38 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
|
|||
$color = array();
|
||||
|
||||
$color[0] = array('border' => '#000000', 'color' => $config['graph_color1'], 'alpha' => 50);
|
||||
$color[1] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50);
|
||||
$color[2] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
||||
$color[1] = array('border' => '#000000', 'color' => $config['graph_color2'], 'alpha' => 50);
|
||||
$color[2] = array('border' => '#000000', 'color' => $config['graph_color3'], 'alpha' => 50);
|
||||
|
||||
switch ($stacked) {
|
||||
case GRAPH_AREA:
|
||||
return area_graph($flash_charts, $graph_values, $width, $height,
|
||||
$color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png"),
|
||||
"", "", $homeurl, $water_mark,
|
||||
$config['fontpath'], $fixed_font_size, "", $ttl);
|
||||
return area_graph($flash_charts, $graph_values, $width,
|
||||
$height, $color, $module_name_list, $long_index,
|
||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
||||
"", $homeurl, $water_mark, $config['fontpath'],
|
||||
$fixed_font_size, "", $ttl);
|
||||
break;
|
||||
default:
|
||||
case GRAPH_STACKED_AREA:
|
||||
return stacked_area_graph($flash_charts, $graph_values, $width, $height,
|
||||
$color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png"),
|
||||
"", "", $water_mark,
|
||||
$config['fontpath'], $fixed_font_size, "", $ttl, $homeurl);
|
||||
return stacked_area_graph($flash_charts, $graph_values,
|
||||
$width, $height, $color, $module_name_list, $long_index,
|
||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
||||
"", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||
"", $ttl, $homeurl);
|
||||
break;
|
||||
case GRAPH_LINE:
|
||||
return line_graph($flash_charts, $graph_values, $width, $height,
|
||||
$color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png"),
|
||||
"", "", $water_mark,
|
||||
$config['fontpath'], $fixed_font_size, "", $ttl, $homeurl);
|
||||
return line_graph($flash_charts, $graph_values, $width,
|
||||
$height, $color, $module_name_list, $long_index,
|
||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
||||
"", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||
"", $ttl, $homeurl);
|
||||
break;
|
||||
case GRAPH_STACKED_LINE:
|
||||
return stacked_line_graph($flash_charts, $graph_values, $width, $height,
|
||||
$color, $module_name_list, $long_index, ui_get_full_url("images/image_problem.opaque.png"),
|
||||
"", "", $water_mark,
|
||||
$config['fontpath'], $fixed_font_size, "", $ttl, $homeurl);
|
||||
return stacked_line_graph($flash_charts, $graph_values,
|
||||
$width, $height, $color, $module_name_list, $long_index,
|
||||
ui_get_full_url("images/image_problem.opaque.png"), "",
|
||||
"", $water_mark, $config['fontpath'], $fixed_font_size,
|
||||
"", $ttl, $homeurl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1016,14 +1016,16 @@ function modules_get_monitors_in_agent ($id_agent) {
|
|||
*/
|
||||
function modules_get_monitors_down ($monitors, $period = 0, $date = 0) {
|
||||
$monitors_down = array ();
|
||||
|
||||
if (empty ($monitors))
|
||||
return $monitors_down;
|
||||
return $monitors_down;
|
||||
|
||||
foreach ($monitors as $monitor) {
|
||||
$down = modules_get_monitor_downs_in_period ($monitor['id_agente_modulo'], $period, $date);
|
||||
if ($down > 0)
|
||||
array_push ($monitors_down, $monitor);
|
||||
}
|
||||
|
||||
return $monitors_down;
|
||||
}
|
||||
|
||||
|
@ -1084,6 +1086,7 @@ function modules_get_moduletypes ($type = "all", $rows = "nombre") {
|
|||
$return[$type["id_tipo"]] = $type[reset ($rows)];
|
||||
}
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
@ -1119,32 +1122,6 @@ function modules_show_icon_type ($id_type) {
|
|||
return (string) db_get_value ('icon', 'ttipo_modulo', 'id_tipo', $id_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a module category name
|
||||
*
|
||||
* @param int Id category
|
||||
*
|
||||
* @return Name of the given category
|
||||
*/
|
||||
function modules_give_modulecategory_name ($id_category) {
|
||||
switch ($id_category) {
|
||||
case 0:
|
||||
return __('Software agent data');
|
||||
break;
|
||||
case 1:
|
||||
return __('Software agent monitor');
|
||||
break;
|
||||
case 2:
|
||||
return __('Network agent data');
|
||||
break;
|
||||
case 3:
|
||||
return __('Network agent monitor');
|
||||
break;
|
||||
}
|
||||
|
||||
return __('Unknown');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get agent id from an agent module.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue