Added synchronization when updates an agent. Ticket #4017

This commit is contained in:
Arturo Gonzalez 2016-09-13 10:28:26 +02:00
parent 05426b9512
commit f11a2ddff6
2 changed files with 13 additions and 0 deletions

View File

@ -751,6 +751,9 @@ if ($update_agent) { // if modified some agent paramenter
__('There was a problem updating the agent'));
}
else {
// Update the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');
enterprise_hook ('agent_update_from_cache', array($id_agente, $values));
if ($old_interval != $intervalo) {
enterprise_hook('config_agents_update_config_interval', array($id_agente, $intervalo));

View File

@ -101,6 +101,11 @@ if ($enable_agent) {
$result = db_process_sql_update('tagente', array('disabled' => 0), array('id_agente' => $enable_agent));
if ($result) {
// Update the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');
$values = array('disabled' => 0);
enterprise_hook ('agent_update_from_cache', array($enable_agent, $values));
db_pandora_audit("Agent management", 'Enable ' . $enable_agent);
}
else {
@ -115,6 +120,11 @@ if ($disable_agent) {
$result = db_process_sql_update('tagente', array('disabled' => 1), array('id_agente' => $disable_agent));
if ($result) {
// Update the agent from the metaconsole cache
enterprise_include_once('include/functions_agents.php');
$values = array('disabled' => 1);
enterprise_hook ('agent_update_from_cache', array($disable_agent, $values));
db_pandora_audit("Agent management", 'Disable ' . $disable_agent);
}
else {