From 1b94ef3eb81e716006439ba2f9d80f33e7b100f4 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Wed, 29 Jul 2015 14:35:55 +0200 Subject: [PATCH] + Enhance http port manage --- centreon/plugins/http.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/centreon/plugins/http.pm b/centreon/plugins/http.pm index e7eab6519..ef0509243 100644 --- a/centreon/plugins/http.pm +++ b/centreon/plugins/http.pm @@ -83,7 +83,7 @@ sub check_options { $self->{output}->option_exit(); } - $options{request}->{port} = $self->get_port(); + $options{request}->{port} = $self->get_port_request(); $options{request}->{headers} = {}; if (defined($options{request}->{header})) { @@ -138,6 +138,16 @@ sub get_port { return $port; } +sub get_port_request { + my ($self, %options) = @_; + + my $port = ''; + if (defined($self->{options}->{port}) && $self->{options}->{port} ne '') { + $port = $self->{options}->{port}; + } + return $port; +} + sub request { my ($self, %options) = @_;