From e1b6ae552a04f073186af7c2663a5749d13304d7 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Fri, 9 May 2014 18:04:10 +0200 Subject: [PATCH] Refs #5385 Put tomcat default port (8080) Add library function --- apps/tomcat/web/mode/applications.pm | 2 +- apps/tomcat/web/mode/listapplication.pm | 2 +- apps/tomcat/web/mode/memory.pm | 2 +- apps/tomcat/web/mode/requestinfo.pm | 4 ++-- apps/tomcat/web/mode/sessions.pm | 2 +- apps/tomcat/web/mode/threads.pm | 2 +- apps/tomcat/web/mode/traffic.pm | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/tomcat/web/mode/applications.pm b/apps/tomcat/web/mode/applications.pm index db89288fb..5501de111 100644 --- a/apps/tomcat/web/mode/applications.pm +++ b/apps/tomcat/web/mode/applications.pm @@ -51,7 +51,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, diff --git a/apps/tomcat/web/mode/listapplication.pm b/apps/tomcat/web/mode/listapplication.pm index 240438f83..770246b4a 100644 --- a/apps/tomcat/web/mode/listapplication.pm +++ b/apps/tomcat/web/mode/listapplication.pm @@ -51,7 +51,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, diff --git a/apps/tomcat/web/mode/memory.pm b/apps/tomcat/web/mode/memory.pm index e5cacff91..844d83dbe 100644 --- a/apps/tomcat/web/mode/memory.pm +++ b/apps/tomcat/web/mode/memory.pm @@ -50,7 +50,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, diff --git a/apps/tomcat/web/mode/requestinfo.pm b/apps/tomcat/web/mode/requestinfo.pm index 1c888cf01..83b62b303 100644 --- a/apps/tomcat/web/mode/requestinfo.pm +++ b/apps/tomcat/web/mode/requestinfo.pm @@ -53,7 +53,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, @@ -238,7 +238,7 @@ sub run { $self->manage_selection(); my $new_datas = {}; - $self->{statefile_value}->read(statefile => 'cache_apps_tomcat_web_' . $self->{option_results}->{hostname} . '_' . $self->{option_results}->{port} . '_' . $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} . '_' . centreon::plugins::httplib::get_port($self) . '_' . $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'); diff --git a/apps/tomcat/web/mode/sessions.pm b/apps/tomcat/web/mode/sessions.pm index 2120a1282..7629580a3 100644 --- a/apps/tomcat/web/mode/sessions.pm +++ b/apps/tomcat/web/mode/sessions.pm @@ -51,7 +51,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, diff --git a/apps/tomcat/web/mode/threads.pm b/apps/tomcat/web/mode/threads.pm index 6e386ba0b..11a98919f 100644 --- a/apps/tomcat/web/mode/threads.pm +++ b/apps/tomcat/web/mode/threads.pm @@ -51,7 +51,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, diff --git a/apps/tomcat/web/mode/traffic.pm b/apps/tomcat/web/mode/traffic.pm index 0b0d7a117..533990bae 100644 --- a/apps/tomcat/web/mode/traffic.pm +++ b/apps/tomcat/web/mode/traffic.pm @@ -54,7 +54,7 @@ sub new { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, - "port:s" => { name => 'port', default => '23002' }, + "port:s" => { name => 'port', default => '8080' }, "proto:s" => { name => 'proto', default => "http" }, "credentials" => { name => 'credentials' }, "username:s" => { name => 'username' }, @@ -223,7 +223,7 @@ sub run { $self->manage_selection(); my $new_datas = {}; - $self->{statefile_value}->read(statefile => 'cache_apps_tomcat_web_' . $self->{option_results}->{hostname} . '_' . $self->{option_results}->{port} . '_' . $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->{option_results}->{port} . '_' . centreon::plugins::httplib::get_port($self) . '_' . (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');