mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Merge branch 'ent-7823-interfaces-view-no-calcula-bien-last-data' into 'develop'
Fixed issue with last_data obtain Closes pandora_enterprise#7823 See merge request artica/pandorafms!4338
This commit is contained in:
commit
a89faed47c
@ -3187,6 +3187,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||||||
$module_description = $module['descripcion'];
|
$module_description = $module['descripcion'];
|
||||||
$db_status = modules_get_agentmodule_status($module_id);
|
$db_status = modules_get_agentmodule_status($module_id);
|
||||||
$module_value = modules_get_last_value($module_id);
|
$module_value = modules_get_last_value($module_id);
|
||||||
|
$last_contact = modules_get_last_contact($module_id);
|
||||||
modules_get_status($module_id, $db_status, $module_value, $status, $title);
|
modules_get_status($module_id, $db_status, $module_value, $status, $title);
|
||||||
$status_image = ui_print_status_image($status, $title, true);
|
$status_image = ui_print_status_image($status, $title, true);
|
||||||
|
|
||||||
@ -3267,6 +3268,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||||||
$agent_interfaces[$interface_name]['status_module_name'] = $module_name;
|
$agent_interfaces[$interface_name]['status_module_name'] = $module_name;
|
||||||
$agent_interfaces[$interface_name]['ip'] = $ip_target;
|
$agent_interfaces[$interface_name]['ip'] = $ip_target;
|
||||||
$agent_interfaces[$interface_name]['mac'] = $mac;
|
$agent_interfaces[$interface_name]['mac'] = $mac;
|
||||||
|
$agent_interfaces[$interface_name]['last_contact'] = $last_contact;
|
||||||
|
|
||||||
if ($interface_traffic_modules !== false) {
|
if ($interface_traffic_modules !== false) {
|
||||||
$agent_interfaces[$interface_name]['traffic'] = [];
|
$agent_interfaces[$interface_name]['traffic'] = [];
|
||||||
|
@ -666,12 +666,6 @@ function print_table(
|
|||||||
time()
|
time()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get last data timestamp.
|
|
||||||
$timestamps_array = array_merge(
|
|
||||||
array_column(ifInOctets, 'utimestamp'),
|
|
||||||
array_column(ifOutOctets, 'utimestamp')
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($sec === 'view') {
|
if ($sec === 'view') {
|
||||||
$table_data[$loop_index]['if_agent_name'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent_interfaces['agent_id'].'">'.$agent_interfaces['agent_alias'].'</a>';
|
$table_data[$loop_index]['if_agent_name'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$agent_interfaces['agent_id'].'">'.$agent_interfaces['agent_alias'].'</a>';
|
||||||
}
|
}
|
||||||
@ -683,12 +677,7 @@ function print_table(
|
|||||||
$table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos'];
|
$table_data[$loop_index]['if_out_octets'] = ($ifOutOctets['datos'] === null) ? __('N/A') : $ifOutOctets['datos'];
|
||||||
$table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos'];
|
$table_data[$loop_index]['if_usage_module_data_in'] = ($usage_module_data_in['datos'] === null) ? __('N/A') : $usage_module_data_in['datos'];
|
||||||
$table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos'];
|
$table_data[$loop_index]['if_usage_module_data_out'] = ($usage_module_data_out['datos'] === null) ? __('N/A') : $usage_module_data_out['datos'];
|
||||||
$table_data[$loop_index]['if_last_data'] = human_time_comparation(
|
$table_data[$loop_index]['if_last_data'] = human_time_comparation($agent_interfaces['last_contact']);
|
||||||
max(
|
|
||||||
$ifInOctets['utimestamp'],
|
|
||||||
$ifOutOctets['utimestamp']
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$loop_index++;
|
$loop_index++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user