Refs #5474
This commit is contained in:
parent
099aee5b38
commit
04e378c76b
|
@ -51,7 +51,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"hostname:s" => { name => 'hostname' },
|
||||
"port:s" => { name => 'port', default => '80' },
|
||||
"port:s" => { name => 'port', },
|
||||
"proto:s" => { name => 'proto', default => "http" },
|
||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||
"credentials" => { name => 'credentials' },
|
||||
|
|
|
@ -52,7 +52,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"hostname:s" => { name => 'hostname' },
|
||||
"port:s" => { name => 'port', default => '80' },
|
||||
"port:s" => { name => 'port', },
|
||||
"proto:s" => { name => 'proto', default => "http" },
|
||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||
"credentials" => { name => 'credentials' },
|
||||
|
|
|
@ -52,7 +52,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"hostname:s" => { name => 'hostname' },
|
||||
"port:s" => { name => 'port', default => '80' },
|
||||
"port:s" => { name => 'port', },
|
||||
"proto:s" => { name => 'proto', default => "http" },
|
||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||
"credentials" => { name => 'credentials' },
|
||||
|
|
|
@ -51,7 +51,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"hostname:s" => { name => 'hostname' },
|
||||
"port:s" => { name => 'port', default => '80' },
|
||||
"port:s" => { name => 'port', },
|
||||
"proto:s" => { name => 'proto', default => "http" },
|
||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||
"credentials" => { name => 'credentials' },
|
||||
|
|
|
@ -51,7 +51,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"hostname:s" => { name => 'hostname' },
|
||||
"port:s" => { name => 'port', default => '80' },
|
||||
"port:s" => { name => 'port', },
|
||||
"proto:s" => { name => 'proto', default => "http" },
|
||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||
"credentials" => { name => 'credentials' },
|
||||
|
|
|
@ -46,8 +46,13 @@ sub connect {
|
|||
my $connection_exit = defined($options{connection_exit}) ? $options{connection_exit} : 'unknown';
|
||||
|
||||
my ($response, $content);
|
||||
my $req;
|
||||
|
||||
my $req = HTTP::Request->new( GET => $self->{option_results}->{proto}. "://" . $self->{option_results}->{hostname}.':'. $self->{option_results}->{port} . $self->{option_results}->{url_path});
|
||||
if (defined($self->{option_results}->{port})) {
|
||||
$req = HTTP::Request->new( GET => $self->{option_results}->{proto}. "://" . $self->{option_results}->{hostname}.':'. $self->{option_results}->{port} . $self->{option_results}->{url_path});
|
||||
} else {
|
||||
$req = HTTP::Request->new( GET => $self->{option_results}->{proto}. "://" . $self->{option_results}->{hostname} . $self->{option_results}->{url_path});
|
||||
}
|
||||
|
||||
if (defined($self->{option_results}->{credentials})) {
|
||||
$req->authorization_basic($self->{option_results}->{username}, $self->{option_results}->{password});
|
||||
|
|
Loading…
Reference in New Issue