Fixed an error which affected to the values of the custom graphs

This commit is contained in:
Alejandro Gallardo Escobar 2016-05-25 17:41:19 +02:00
parent 3179a206a4
commit e4758e9731

View File

@ -1425,12 +1425,14 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$search_in_history_db = db_search_in_history_db($datelimit); $search_in_history_db = db_search_in_history_db($datelimit);
$temp[$module] = modules_get_agentmodule($module); $temp[$module] = modules_get_agentmodule($module);
$temp_data = db_get_value_sql('SELECT datos $query_last_value = sprintf('
FROM tagente_datos SELECT datos
WHERE id_agente_modulo = ' . (int) $module . FROM tagente_datos
' AND utimestamp > ' . (int) $datelimit . WHERE id_agente_modulo = %d
' AND utimestamp < ' . (int) $date) . AND utimestamp < %d
" ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC',
$module, $date);
$temp_data = db_get_value_sql($query_last_value);
if ($temp_data) { if ($temp_data) {
if (is_numeric($temp_data)) if (is_numeric($temp_data))
@ -1481,12 +1483,14 @@ function graphic_combined_module ($module_list, $weight_list, $period,
$module_data = modules_get_agentmodule($module); $module_data = modules_get_agentmodule($module);
$temp_data = db_get_value_sql('SELECT datos $query_last_value = sprintf('
FROM tagente_datos SELECT datos
WHERE id_agente_modulo = ' . (int) $module . FROM tagente_datos
' AND utimestamp > ' . (int) $datelimit . WHERE id_agente_modulo = %d
' AND utimestamp < ' . (int) $date) . AND utimestamp < %d
" ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC',
$module, $date);
$temp_data = db_get_value_sql($query_last_value);
$agent_name = io_safe_output( $agent_name = io_safe_output(
modules_get_agentmodule_agent_name ($module)); modules_get_agentmodule_agent_name ($module));
@ -1521,14 +1525,20 @@ function graphic_combined_module ($module_list, $weight_list, $period,
} }
} }
if ($automatic_custom_graph_meta)
$module = $module_item['module'];
else
$module = $module_item;
$data_module = modules_get_agentmodule($module); $data_module = modules_get_agentmodule($module);
$temp_data = db_get_value_sql('SELECT datos $query_last_value = sprintf('
FROM tagente_datos SELECT datos
WHERE id_agente_modulo = ' . (int) $module . FROM tagente_datos
' AND utimestamp > ' . (int) $datelimit . WHERE id_agente_modulo = %d
' AND utimestamp < ' . (int) $date) . AND utimestamp < %d
" ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC',
$module, $date);
$temp_data = db_get_value_sql($query_last_value);
if ( $temp_data ){ if ( $temp_data ){
if (is_numeric($temp_data)) if (is_numeric($temp_data))
$value = $temp_data; $value = $temp_data;
@ -1574,14 +1584,20 @@ function graphic_combined_module ($module_list, $weight_list, $period,
} }
} }
if ($automatic_custom_graph_meta)
$module = $module_item['module'];
else
$module = $module_item;
$temp[$module] = modules_get_agentmodule($module); $temp[$module] = modules_get_agentmodule($module);
$temp_data = db_get_value_sql('SELECT datos $query_last_value = sprintf('
FROM tagente_datos SELECT datos
WHERE id_agente_modulo = ' . (int) $module . FROM tagente_datos
' AND utimestamp > ' . (int) $datelimit . WHERE id_agente_modulo = %d
' AND utimestamp < ' . (int) $date) . AND utimestamp < %d
" ORDER BY utimestamp DESC"; ORDER BY utimestamp DESC',
$module, $date);
$temp_data = db_get_value_sql($query_last_value);
if ( $temp_data ) { if ( $temp_data ) {
if (is_numeric($temp_data)) if (is_numeric($temp_data))
$value = $temp_data; $value = $temp_data;