This commit is contained in:
XiCoN-FJS- 2019-10-19 23:29:22 +02:00
parent 22d6609a55
commit 715100e4ed

View File

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