External Monitor on Perl
Hi, I have set this External Monitor, on a BIG-IP Virtual, just whit GTM:
use LWP::UserAgent;
my $url = ''; my $timeout = 20; my $agent = 'MA Performance Test Agent'; my $username = '1158553890'; my $password = '121e4f6b2d93d3f508359c8700406a1b992733af'; my $ua = LWP::UserAgent->new; $ua->agent($agent); $ua->timeout($timeout);
my $requestbody = qq({"client":{"osName":"Android","osVersion":"4.3","platform":"Android"},"password":"${password}","username":"${username}","requestId":"d094e3c7-e599-480e-83b6-f651344c66d6","rememberMe":false}});
my $request = HTTP::Request->new("POST","${url}/login",undef,$requestbody); $request->header('Accept' => "application/json", 'Accept-Charset' => "utf-8", 'cid' => 'a4a99111-b62a-4483-9598-8cfd13ed5ad4'); $request->content_type('application/json'); my $response = $ua->request($request);
if ($response->is_success) { my $content = $response->decoded_content; print "SUCCESSFUL RESPONSE\nBEGIN\n$content\nEND\n"; my ($email) = ($content =~ m/"email":"([^"]*)"/); print "Email address: $email\n"; } else { printf "FAIL (%d) : %s '%s'\n", $response->code, $url, $response->status_line; }
If I run this from the command line, the script runs successfully, they returns me the print "SUCCESSFUL RESPONSE" . But on the BIG-IP web, the monitor doesn't. Do you have any idea about this!?.
Regards.