Changed function that creates a new agent from metaconsole to set field name with a hash and fixed bug when setting alias in database

This commit is contained in:
alejandro-campos 2018-10-19 10:43:43 +02:00
parent 14419759b0
commit 3fd588353b
1 changed files with 2 additions and 1 deletions

View File

@ -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;