mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-31 01:24:35 +02:00
27 lines
529 B
Perl
27 lines
529 B
Perl
#!/usr/bin/perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
use Net::Curl::Easy qw(:constants);
|
|
|
|
# URL to fetch
|
|
my $url = 'https://www.centreon.com';
|
|
|
|
# Create a new Curl object
|
|
my $curl = Net::Curl::Easy->new();
|
|
|
|
# Prepare the request
|
|
$curl->setopt(CURLOPT_URL, $url);
|
|
my $response_body;
|
|
$curl->setopt(CURLOPT_WRITEDATA, \$response_body);
|
|
|
|
# Perform the request
|
|
eval {
|
|
$curl->perform();
|
|
};
|
|
die "Unable to fetch URL $url: $@" if $@;
|
|
|
|
# Print the response body
|
|
print "Response body:\n$response_body\n";
|
|
|
|
print "Test completed successfully.\n"; |