From 0f27bd1e26d5206fd7af14863b818780070f702c Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Wed, 18 Sep 2013 15:32:28 -0700 Subject: [PATCH] Stop running pt-agent if init_agent() gets 404. --- bin/pt-agent | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/pt-agent b/bin/pt-agent index f6fe07b0..851261d9 100755 --- a/bin/pt-agent +++ b/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);