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 File::Fetch;
use PerlIO::gzip;
use LWP::UserAgent;
use HTTP::Tiny;
use HTTP::Request;
use Data::Validate::IP qw(is_ipv4);
use Data::Dumper;
@ -88,10 +88,9 @@ sub check_server_status
{
my ($hostname,$port) = @_;
my $url = "http://".$hostname.":".$port."/v3/client/info/version";
my $ua = LWP::UserAgent->new(timeout => 2);
my $req = HTTP::Request->new("GET", $url);
my $response = $ua->request($req);
my @return_code = ($response->is_success, $response->decoded_content);
my $httptiny = HTTP::Tiny->new("timeout" => 2);
my $response = $httptiny->request("GET",$url);
my @return_code = ($response->{'success'}, $response->{'content'});
return @return_code;
}