v4
This commit is contained in:
parent
22d6609a55
commit
715100e4ed
9
xtrd.pl
9
xtrd.pl
@ -7,7 +7,7 @@ use Socket;
|
|||||||
use DBI;
|
use DBI;
|
||||||
use File::Fetch;
|
use File::Fetch;
|
||||||
use PerlIO::gzip;
|
use PerlIO::gzip;
|
||||||
use LWP::UserAgent;
|
use HTTP::Tiny;
|
||||||
use HTTP::Request;
|
use HTTP::Request;
|
||||||
use Data::Validate::IP qw(is_ipv4);
|
use Data::Validate::IP qw(is_ipv4);
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
@ -88,10 +88,9 @@ sub check_server_status
|
|||||||
{
|
{
|
||||||
my ($hostname,$port) = @_;
|
my ($hostname,$port) = @_;
|
||||||
my $url = "http://".$hostname.":".$port."/v3/client/info/version";
|
my $url = "http://".$hostname.":".$port."/v3/client/info/version";
|
||||||
my $ua = LWP::UserAgent->new(timeout => 2);
|
my $httptiny = HTTP::Tiny->new("timeout" => 2);
|
||||||
my $req = HTTP::Request->new("GET", $url);
|
my $response = $httptiny->request("GET",$url);
|
||||||
my $response = $ua->request($req);
|
my @return_code = ($response->{'success'}, $response->{'content'});
|
||||||
my @return_code = ($response->is_success, $response->decoded_content);
|
|
||||||
return @return_code;
|
return @return_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user