From 3fd588353bcfdeb4c8c79da873f2d3727955e26e Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Fri, 19 Oct 2018 10:43:43 +0200 Subject: [PATCH] Changed function that creates a new agent from metaconsole to set field name with a hash and fixed bug when setting alias in database --- pandora_console/include/functions_agents.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 2e9ef1f55f..6fee80a664 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -94,7 +94,8 @@ function agents_create_agent ($name, $id_group, $interval, $ip_address, $values if (! is_array ($values)) $values = array (); - $values['nombre'] = $name; + $values['alias'] = $name; + $values['nombre'] = hash("sha256",$name . "|" .$ip_address ."|". time() ."|". sprintf("%04d", rand(0,10000))); $values['id_grupo'] = $id_group; $values['intervalo'] = $interval;