mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Stop running pt-agent if init_agent() gets 404.
This commit is contained in:
11
bin/pt-agent
11
bin/pt-agent
@@ -5777,7 +5777,16 @@ sub init_agent {
|
||||
);
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
$logger->warning($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);
|
||||
}
|
||||
}
|
||||
elsif ( !$agent_uri ) {
|
||||
$logger->info("No URI for Agent " . $agent->name);
|
||||
|
Reference in New Issue
Block a user