parent
d024c2f9c5
commit
6a83ff0582
|
@ -34,11 +34,14 @@
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package centreon::plugins::options;
|
package centreon::plugins::options;
|
||||||
|
|
||||||
use Pod::Usage;
|
use Pod::Usage;
|
||||||
use Pod::Find qw(pod_where);
|
use Pod::Find qw(pod_where);
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
Getopt::Long::Configure("pass_through");
|
Getopt::Long::Configure("pass_through");
|
||||||
Getopt::Long::Configure('bundling');
|
Getopt::Long::Configure('bundling');
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
|
@ -61,9 +64,9 @@ sub set_output {
|
||||||
sub display_help {
|
sub display_help {
|
||||||
my ($self, %options) = @_;
|
my ($self, %options) = @_;
|
||||||
|
|
||||||
|
my $stdout;
|
||||||
foreach (@{$self->{pod_package}}) {
|
foreach (@{$self->{pod_package}}) {
|
||||||
my $stdout;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
local *STDOUT;
|
local *STDOUT;
|
||||||
open STDOUT, '>', \$stdout;
|
open STDOUT, '>', \$stdout;
|
||||||
|
@ -88,9 +91,9 @@ sub add_help {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($options{help_first})) {
|
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 {
|
} 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;
|
$self->{pod_packages_once}->{$options{package}} = 1;
|
||||||
|
|
|
@ -34,8 +34,11 @@
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package centreon::plugins::output;
|
package centreon::plugins::output;
|
||||||
|
|
||||||
use Encode;
|
use Encode;
|
||||||
use centreon::plugins::misc;
|
use centreon::plugins::misc;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
|
|
||||||
package centreon::plugins::perfdata;
|
package centreon::plugins::perfdata;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %options) = @_;
|
my ($class, %options) = @_;
|
||||||
my $self = {};
|
my $self = {};
|
||||||
|
@ -122,14 +125,16 @@ sub parse_threshold {
|
||||||
my $global_status = 1;
|
my $global_status = 1;
|
||||||
|
|
||||||
if ($perf =~ /^(\@?)((?:~|(?:\+|-)?\d+(?:[\.,]\d+)?|):)?((?:\+|-)?\d+(?:[\.,]\d+)?)?$/) {
|
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_start =~ s/[\+:]//g;
|
||||||
$value_end =~ s/\+//;
|
$value_end =~ s/\+//;
|
||||||
if (!defined($value_end)) {
|
if ($value_end eq '') {
|
||||||
$value_end = 1e500;
|
$value_end = 1e500;
|
||||||
$infinite_pos = 1;
|
$infinite_pos = 1;
|
||||||
}
|
}
|
||||||
$value_start = 0 if (!defined($value_start) || $value_start eq '');
|
$value_start = 0 if ($value_start eq '');
|
||||||
$value_start =~ s/,/\./;
|
$value_start =~ s/,/\./;
|
||||||
$value_end =~ s/,/\./;
|
$value_end =~ s/,/\./;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
package centreon::plugins::statefile;
|
package centreon::plugins::statefile;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use vars qw($datas);
|
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)
|
Specify password for basic authentification (Mandatory if --credentials is specidied)
|
||||||
|
|
||||||
=item B<--password>
|
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP 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)
|
Specify password for basic authentification (Mandatory if --credentials is specidied)
|
||||||
|
|
||||||
=item B<--password>
|
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP 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)
|
Specify password for basic authentification (Mandatory if --credentials is specidied)
|
||||||
|
|
||||||
=item B<--password>
|
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP 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)
|
Specify password for basic authentification (Mandatory if --credentials is specidied)
|
||||||
|
|
||||||
=item B<--password>
|
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP 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)
|
Specify password for basic authentification (Mandatory if --credentials is specidied)
|
||||||
|
|
||||||
=item B<--password>
|
|
||||||
|
|
||||||
=item B<--timeout>
|
=item B<--timeout>
|
||||||
|
|
||||||
Threshold for HTTP timeout
|
Threshold for HTTP timeout
|
||||||
|
|
Loading…
Reference in New Issue