parent
d024c2f9c5
commit
6a83ff0582
|
@ -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;
|
||||
|
|
|
@ -34,8 +34,11 @@
|
|||
####################################################################################
|
||||
|
||||
package centreon::plugins::output;
|
||||
|
||||
use Encode;
|
||||
use centreon::plugins::misc;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
sub new {
|
||||
my ($class, %options) = @_;
|
||||
|
|
|
@ -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/,/\./;
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
####################################################################################
|
||||
|
||||
package centreon::plugins::statefile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
use vars qw($datas);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue