diff --git a/centreon/plugins/options.pm b/centreon/plugins/options.pm index 73acddc6c..52743ffd0 100644 --- a/centreon/plugins/options.pm +++ b/centreon/plugins/options.pm @@ -34,11 +34,14 @@ #################################################################################### package centreon::plugins::options; + use Pod::Usage; use Pod::Find qw(pod_where); use Getopt::Long; Getopt::Long::Configure("pass_through"); Getopt::Long::Configure('bundling'); +use strict; +use warnings; sub new { my $class = shift; @@ -61,9 +64,9 @@ sub set_output { sub display_help { my ($self, %options) = @_; + my $stdout; foreach (@{$self->{pod_package}}) { - my $stdout; - + { local *STDOUT; open STDOUT, '>', \$stdout; @@ -88,9 +91,9 @@ sub add_help { } if (defined($options{help_first})) { - shift @{$self->{pod_package}}, {package => $options{package}, sections => $options{sections}}; + unshift @{$self->{pod_package}}, {package => $options{package}, sections => $options{sections}}; } else { - push @{$self->{pod_package}}, {package => $options{package}, sections => $options{sections}}; + push @{$self->{pod_package}}, { package => $options{package}, sections => $options{sections} }; } $self->{pod_packages_once}->{$options{package}} = 1; diff --git a/centreon/plugins/output.pm b/centreon/plugins/output.pm index 69b3ef2e9..fb1c4f8db 100644 --- a/centreon/plugins/output.pm +++ b/centreon/plugins/output.pm @@ -34,8 +34,11 @@ #################################################################################### package centreon::plugins::output; + use Encode; use centreon::plugins::misc; +use strict; +use warnings; sub new { my ($class, %options) = @_; diff --git a/centreon/plugins/perfdata.pm b/centreon/plugins/perfdata.pm index f8ebb617e..c689e6201 100644 --- a/centreon/plugins/perfdata.pm +++ b/centreon/plugins/perfdata.pm @@ -35,6 +35,9 @@ package centreon::plugins::perfdata; +use strict; +use warnings; + sub new { my ($class, %options) = @_; my $self = {}; @@ -122,14 +125,16 @@ sub parse_threshold { my $global_status = 1; if ($perf =~ /^(\@?)((?:~|(?:\+|-)?\d+(?:[\.,]\d+)?|):)?((?:\+|-)?\d+(?:[\.,]\d+)?)?$/) { - ($exclusive, $value_start, $value_end) = ($1, $2, $3); + $value_start = $2 if (defined($2)); + $value_end = $3 if (defined($3)); + $arobase = 1 if (defined($1) && $1 eq '@'); $value_start =~ s/[\+:]//g; $value_end =~ s/\+//; - if (!defined($value_end)) { + if ($value_end eq '') { $value_end = 1e500; $infinite_pos = 1; } - $value_start = 0 if (!defined($value_start) || $value_start eq ''); + $value_start = 0 if ($value_start eq ''); $value_start =~ s/,/\./; $value_end =~ s/,/\./; diff --git a/centreon/plugins/statefile.pm b/centreon/plugins/statefile.pm index 3a4f6c200..a4379a963 100644 --- a/centreon/plugins/statefile.pm +++ b/centreon/plugins/statefile.pm @@ -34,6 +34,9 @@ #################################################################################### package centreon::plugins::statefile; + +use strict; +use warnings; use Data::Dumper; use vars qw($datas); diff --git a/hardware/sensors/sequoia/em01/web/mode/contact.pm b/hardware/sensors/sequoia/em01/web/mode/contact.pm index 1c32fd2ff..b5f3afdb1 100644 --- a/hardware/sensors/sequoia/em01/web/mode/contact.pm +++ b/hardware/sensors/sequoia/em01/web/mode/contact.pm @@ -156,8 +156,6 @@ Specify username for basic authentification (Mandatory if --credentials is speci Specify password for basic authentification (Mandatory if --credentials is specidied) -=item B<--password> - =item B<--timeout> Threshold for HTTP timeout diff --git a/hardware/sensors/sequoia/em01/web/mode/humidity.pm b/hardware/sensors/sequoia/em01/web/mode/humidity.pm index e81b2ea49..ce356d3ac 100644 --- a/hardware/sensors/sequoia/em01/web/mode/humidity.pm +++ b/hardware/sensors/sequoia/em01/web/mode/humidity.pm @@ -157,8 +157,6 @@ Specify username for basic authentification (Mandatory if --credentials is speci Specify password for basic authentification (Mandatory if --credentials is specidied) -=item B<--password> - =item B<--timeout> Threshold for HTTP timeout diff --git a/hardware/sensors/sequoia/em01/web/mode/illumination.pm b/hardware/sensors/sequoia/em01/web/mode/illumination.pm index be97ca196..0618ff12e 100644 --- a/hardware/sensors/sequoia/em01/web/mode/illumination.pm +++ b/hardware/sensors/sequoia/em01/web/mode/illumination.pm @@ -157,8 +157,6 @@ Specify username for basic authentification (Mandatory if --credentials is speci Specify password for basic authentification (Mandatory if --credentials is specidied) -=item B<--password> - =item B<--timeout> Threshold for HTTP timeout diff --git a/hardware/sensors/sequoia/em01/web/mode/temperature.pm b/hardware/sensors/sequoia/em01/web/mode/temperature.pm index 17fe3ab6b..12c973283 100644 --- a/hardware/sensors/sequoia/em01/web/mode/temperature.pm +++ b/hardware/sensors/sequoia/em01/web/mode/temperature.pm @@ -156,8 +156,6 @@ Specify username for basic authentification (Mandatory if --credentials is speci Specify password for basic authentification (Mandatory if --credentials is specidied) -=item B<--password> - =item B<--timeout> Threshold for HTTP timeout diff --git a/hardware/sensors/sequoia/em01/web/mode/voltage.pm b/hardware/sensors/sequoia/em01/web/mode/voltage.pm index a42be9400..206463b59 100644 --- a/hardware/sensors/sequoia/em01/web/mode/voltage.pm +++ b/hardware/sensors/sequoia/em01/web/mode/voltage.pm @@ -157,8 +157,6 @@ Specify username for basic authentification (Mandatory if --credentials is speci Specify password for basic authentification (Mandatory if --credentials is specidied) -=item B<--password> - =item B<--timeout> Threshold for HTTP timeout