From 116adafbefed93d462c9c55f8630e5dc20b71fda Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 11 Jun 2013 10:11:58 -0700 Subject: [PATCH] Fix parsing server error message. Add 'sending' and 'running' suffixes to service names. --- bin/pt-agent | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/pt-agent b/bin/pt-agent index cbfa20ca..3f3c2f29 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -6788,7 +6788,7 @@ sub run_service { # Load the Service object from local service JSON file. # $service changes from a string scalar to a Service object. $service = load_service( - service => $service, + service => "$service running", lib_dir => $lib_dir, ); @@ -7209,7 +7209,7 @@ sub send_data { # Load the Service object from local service JSON file. # $service changes from a string scalar to a Service object. $service = load_service( - service => $service, + service => "$service sending", lib_dir => $lib_dir, ); @@ -7246,8 +7246,8 @@ sub send_data { my $error_msg; my $content = $client->response->content; if ( $content ) { - my $error_hashref = decode_json($content); - $error_msg = $error_hashref->{error}; + my $errors = decode_json($content); + $error_msg = join("\n", @$errors); } $logger->warning('Error ' . $e->status . " sending $data_file: " . ($error_msg || '(No error message from server)'));