mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
Fix agent sinchronization from node to metaconsole when enable/disable and have same id_agent in their nodes - #1669
This commit is contained in:
parent
9869433f6b
commit
a97c8dde6d
@ -812,7 +812,7 @@ if ($update_agent) { // if modified some agent paramenter
|
|||||||
else {
|
else {
|
||||||
// Update the agent from the metaconsole cache
|
// Update the agent from the metaconsole cache
|
||||||
enterprise_include_once('include/functions_agents.php');
|
enterprise_include_once('include/functions_agents.php');
|
||||||
enterprise_hook ('agent_update_from_cache', array($id_agente, $values));
|
enterprise_hook ('agent_update_from_cache', array($id_agente, $values,$server_name));
|
||||||
|
|
||||||
if ($old_interval != $intervalo) {
|
if ($old_interval != $intervalo) {
|
||||||
enterprise_hook('config_agents_update_config_interval', array($id_agente, $intervalo));
|
enterprise_hook('config_agents_update_config_interval', array($id_agente, $intervalo));
|
||||||
|
@ -67,6 +67,14 @@ $agent_to_delete = (int)get_parameter('borrar_agente');
|
|||||||
$enable_agent = (int)get_parameter('enable_agent');
|
$enable_agent = (int)get_parameter('enable_agent');
|
||||||
$disable_agent = (int)get_parameter('disable_agent');
|
$disable_agent = (int)get_parameter('disable_agent');
|
||||||
|
|
||||||
|
if($disable_agent != 0){
|
||||||
|
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$disable_agent);
|
||||||
|
}
|
||||||
|
elseif ($enable_agent != 0) {
|
||||||
|
$server_name = db_get_row_sql('select server_name from tagente where id_agente = '.$enable_agent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$result = null;
|
$result = null;
|
||||||
|
|
||||||
if ($agent_to_delete) {
|
if ($agent_to_delete) {
|
||||||
@ -106,7 +114,7 @@ if ($enable_agent) {
|
|||||||
// Update the agent from the metaconsole cache
|
// Update the agent from the metaconsole cache
|
||||||
enterprise_include_once('include/functions_agents.php');
|
enterprise_include_once('include/functions_agents.php');
|
||||||
$values = array('disabled' => 0);
|
$values = array('disabled' => 0);
|
||||||
enterprise_hook ('agent_update_from_cache', array($enable_agent, $values));
|
enterprise_hook ('agent_update_from_cache', array($enable_agent, $values,$server_name));
|
||||||
|
|
||||||
db_pandora_audit("Agent management", 'Enable ' . $alias);
|
db_pandora_audit("Agent management", 'Enable ' . $alias);
|
||||||
}
|
}
|
||||||
@ -126,7 +134,7 @@ if ($disable_agent) {
|
|||||||
// Update the agent from the metaconsole cache
|
// Update the agent from the metaconsole cache
|
||||||
enterprise_include_once('include/functions_agents.php');
|
enterprise_include_once('include/functions_agents.php');
|
||||||
$values = array('disabled' => 1);
|
$values = array('disabled' => 1);
|
||||||
enterprise_hook ('agent_update_from_cache', array($disable_agent, $values));
|
enterprise_hook ('agent_update_from_cache', array($disable_agent, $values,$server_name));
|
||||||
|
|
||||||
db_pandora_audit("Agent management", 'Disable ' . $alias);
|
db_pandora_audit("Agent management", 'Disable ' . $alias);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user