mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 14:18:32 +00:00
Stop running pt-agent if init_agent() gets 404.
This commit is contained in:
@@ -5777,8 +5777,17 @@ sub init_agent {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
if ( $EVAL_ERROR ) {
|
if ( $EVAL_ERROR ) {
|
||||||
|
my $code = $client->response->code;
|
||||||
|
if ( $code && $code == 404 ) {
|
||||||
|
$logger->fatal("API reports agent not found: the agent has been "
|
||||||
|
. "deleted, or its UUID (" . ($agent->uuid || '?')
|
||||||
|
. "is wrong. Check https://cloud.percona.com/agents for a "
|
||||||
|
. "list of active agents.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
$logger->warning($EVAL_ERROR);
|
$logger->warning($EVAL_ERROR);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
elsif ( !$agent_uri ) {
|
elsif ( !$agent_uri ) {
|
||||||
$logger->info("No URI for Agent " . $agent->name);
|
$logger->info("No URI for Agent " . $agent->name);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user