+ Fix get_port http call (Ref #108)
This commit is contained in:
parent
61084c2717
commit
823178f284
|
@ -115,7 +115,7 @@ sub run {
|
|||
$avg_bPerSec = '0' . $avg_bPerSec if ($avg_bPerSec =~ /^\./);
|
||||
$bPerReq = '0' . $bPerReq if ($bPerReq =~ /^\./);
|
||||
|
||||
$self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
||||
$self->{statefile_value}->read(statefile => 'apache_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||
my $old_total_access = $self->{statefile_value}->get(name => 'total_access');
|
||||
my $old_total_bytes = $self->{statefile_value}->get(name => 'total_bytes');
|
||||
|
|
|
@ -262,7 +262,7 @@ sub run {
|
|||
$self->manage_selection();
|
||||
|
||||
$self->{new_datas} = {};
|
||||
$self->{statefile_value}->read(statefile => "apc_" . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
||||
$self->{statefile_value}->read(statefile => "apc_" . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||
$self->{new_datas}->{last_timestamp} = time();
|
||||
|
||||
my ($short_msg, $short_msg_append, $long_msg, $long_msg_append) = ('', '', '', '');
|
||||
|
|
|
@ -86,7 +86,7 @@ sub check_options {
|
|||
sub run {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{statefile_value}->read(statefile => 'bluemind_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
||||
$self->{statefile_value}->read(statefile => 'bluemind_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||
|
||||
my $new_datas = {};
|
||||
|
|
|
@ -75,7 +75,7 @@ sub check_options {
|
|||
sub run {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{statefile_value}->read(statefile => 'github_' . $self->{option_results}->{repository} . '_' . $self->{option_results}->{owner} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
||||
$self->{statefile_value}->read(statefile => 'github_' . $self->{option_results}->{repository} . '_' . $self->{option_results}->{owner} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||
|
||||
my $new_datas = {};
|
||||
|
|
|
@ -89,7 +89,7 @@ sub run {
|
|||
my $new_datas = {};
|
||||
my $old_datas = {};
|
||||
|
||||
$self->{statefile_value}->read(statefile => 'nginx_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode});
|
||||
$self->{statefile_value}->read(statefile => 'nginx_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode});
|
||||
$old_datas->{timestamp} = $self->{statefile_value}->get(name => 'timestamp');
|
||||
$new_datas->{timestamp} = time();
|
||||
foreach (@{$maps}) {
|
||||
|
|
|
@ -69,10 +69,6 @@ sub check_options {
|
|||
|
||||
sub run {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
if (!defined($self->{option_results}->{port})) {
|
||||
$self->{option_results}->{port} = centreon::plugins::httplib::get_port($self);
|
||||
}
|
||||
|
||||
my ($connection, $timing0, $timeelapsed);
|
||||
if (defined($self->{option_results}->{ssl})) {
|
||||
|
|
|
@ -67,10 +67,6 @@ sub check_options {
|
|||
sub run {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
if (!defined($self->{option_results}->{port})) {
|
||||
$self->{option_results}->{port} = centreon::plugins::httplib::get_port($self);
|
||||
}
|
||||
|
||||
my $icmp_sock = new IO::Socket::INET(Proto=>"icmp");
|
||||
my $read_set = new IO::Select();
|
||||
$read_set->add($icmp_sock);
|
||||
|
|
|
@ -213,7 +213,7 @@ sub run {
|
|||
$self->manage_selection();
|
||||
|
||||
my $new_datas = {};
|
||||
$self->{statefile_value}->read(statefile => 'cache_apps_tomcat_web_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode} . '_' . (defined($self->{option_results}->{name}) ? md5_hex($self->{option_results}->{name}) : md5_hex('all')));
|
||||
$self->{statefile_value}->read(statefile => 'cache_apps_tomcat_web_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode} . '_' . (defined($self->{option_results}->{name}) ? md5_hex($self->{option_results}->{name}) : md5_hex('all')));
|
||||
$new_datas->{last_timestamp} = time();
|
||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ sub run {
|
|||
$self->manage_selection();
|
||||
|
||||
my $new_datas = {};
|
||||
$self->{statefile_value}->read(statefile => 'cache_apps_tomcat_web_' . $self->{option_results}->{hostname} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $self->{mode} . '_' . (defined($self->{option_results}->{name}) ? md5_hex($self->{option_results}->{name}) : md5_hex('all')));
|
||||
$self->{statefile_value}->read(statefile => 'cache_apps_tomcat_web_' . $self->{option_results}->{hostname} . '_' . $self->{http}->get_port() . '_' . $self->{mode} . '_' . (defined($self->{option_results}->{name}) ? md5_hex($self->{option_results}->{name}) : md5_hex('all')));
|
||||
$new_datas->{last_timestamp} = time();
|
||||
my $old_timestamp = $self->{statefile_value}->get(name => 'last_timestamp');
|
||||
|
||||
|
|
Loading…
Reference in New Issue