Stop running pt-agent if init_agent() gets 404.

This commit is contained in:
Daniel Nichter
2013-09-18 15:32:28 -07:00
parent 3ebd66b8e9
commit 0f27bd1e26

View File

@@ -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);
} }