#13783 fix conect node event meta

This commit is contained in:
Jonathan 2024-05-24 11:30:42 +02:00
parent 5ef49024bf
commit 61040b7991
1 changed files with 10 additions and 9 deletions

View File

@ -3841,18 +3841,23 @@ function events_get_response_target(
include_once $config['homedir'].'/vendor/autoload.php';
if (is_metaconsole() === true && (int) $server_id > 0) {
$node = new Node($server_id);
$node->connect();
}
try {
$eventObjt = new PandoraFMS\Event($event_id);
} catch (Exception $e) {
$eventObjt = new PandoraFMS\Event();
}
if (is_metaconsole() === true && (int) $server_id > 0) {
$node = new Node($server_id);
$node->connect();
}
$event = db_get_row('tevento', 'id_evento', $event_id);
if (is_metaconsole() === true && $server_id > 0) {
$node->disconnect();
}
$target = io_safe_output(db_get_value('target', 'tevent_response', 'id', $event_response['id']));
// Replace parameters response.
@ -4243,10 +4248,6 @@ function events_get_response_target(
);
}
if (is_metaconsole() === true && $server_id > 0) {
$node->disconnect();
}
return $target;
}