mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
Fix 2537 (#2593)
This commit is contained in:
parent
45cad065cd
commit
beb682cac8
@ -65,11 +65,12 @@ sub custom_value_output {
|
|||||||
|
|
||||||
my $label = $self->{result_values}->{label};
|
my $label = $self->{result_values}->{label};
|
||||||
$label =~ s/_/ /g;
|
$label =~ s/_/ /g;
|
||||||
$label =~ s/(\w+)/\u$1/g;
|
return sprintf(
|
||||||
my $msg = sprintf("%s : %s (%.2f %%)",
|
"%s: %s (%.2f %%)",
|
||||||
ucfirst($label),
|
$label,
|
||||||
$self->{result_values}->{used}, $self->{result_values}->{prct});
|
$self->{result_values}->{used},
|
||||||
return $msg;
|
$self->{result_values}->{prct}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub custom_value_calc {
|
sub custom_value_calc {
|
||||||
@ -200,17 +201,17 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
"hostname:s" => { name => 'hostname' },
|
'hostname:s' => { name => 'hostname' },
|
||||||
"port:s" => { name => 'port', },
|
'port:s' => { name => 'port', },
|
||||||
"proto:s" => { name => 'proto' },
|
'proto:s' => { name => 'proto' },
|
||||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
'urlpath:s' => { name => 'url_path', default => "/server-status/?auto" },
|
||||||
"credentials" => { name => 'credentials' },
|
'credentials' => { name => 'credentials' },
|
||||||
"basic" => { name => 'basic' },
|
'basic' => { name => 'basic' },
|
||||||
"username:s" => { name => 'username' },
|
'username:s' => { name => 'username' },
|
||||||
"password:s" => { name => 'password' },
|
'password:s' => { name => 'password' },
|
||||||
"header:s@" => { name => 'header' },
|
'header:s@' => { name => 'header' },
|
||||||
"timeout:s" => { name => 'timeout' },
|
'timeout:s' => { name => 'timeout' },
|
||||||
"units:s" => { name => 'units', default => '%' },
|
'units:s' => { name => 'units', default => '%' }
|
||||||
});
|
});
|
||||||
|
|
||||||
$self->{http} = centreon::plugins::http->new(%options);
|
$self->{http} = centreon::plugins::http->new(%options);
|
||||||
@ -241,8 +242,8 @@ sub manage_selection {
|
|||||||
|
|
||||||
$self->{global} = {
|
$self->{global} = {
|
||||||
total => length($ScoreBoard),
|
total => length($ScoreBoard),
|
||||||
free => ($ScoreBoard =~ tr/\.//),
|
free => ($ScoreBoard =~ tr/\.//) + ($ScoreBoard =~ tr/\_//),
|
||||||
busy => length($ScoreBoard) - ($ScoreBoard =~ tr/\.//),
|
busy => length($ScoreBoard) - ($ScoreBoard =~ tr/\.//) - ($ScoreBoard =~ tr/\_//),
|
||||||
waiting => ($ScoreBoard =~ tr/\_//), starting => ($ScoreBoard =~ tr/S//),
|
waiting => ($ScoreBoard =~ tr/\_//), starting => ($ScoreBoard =~ tr/S//),
|
||||||
reading => ($ScoreBoard =~ tr/R//), sending => ($ScoreBoard =~ tr/W//),
|
reading => ($ScoreBoard =~ tr/R//), sending => ($ScoreBoard =~ tr/W//),
|
||||||
keepalive => ($ScoreBoard =~ tr/K//), dns_lookup => ($ScoreBoard =~ tr/D//),
|
keepalive => ($ScoreBoard =~ tr/K//), dns_lookup => ($ScoreBoard =~ tr/D//),
|
||||||
|
@ -30,13 +30,13 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{$self->{modes}} = (
|
$self->{modes} = {
|
||||||
'cpuload' => 'apps::apache::serverstatus::mode::cpuload',
|
'cpuload' => 'apps::apache::serverstatus::mode::cpuload',
|
||||||
'responsetime' => 'apps::apache::serverstatus::mode::responsetime',
|
'responsetime' => 'apps::apache::serverstatus::mode::responsetime',
|
||||||
'requests' => 'apps::apache::serverstatus::mode::requests',
|
'requests' => 'apps::apache::serverstatus::mode::requests',
|
||||||
'slotstates' => 'apps::apache::serverstatus::mode::slotstates',
|
'slotstates' => 'apps::apache::serverstatus::mode::slotstates',
|
||||||
'workers' => 'apps::apache::serverstatus::mode::workers',
|
'workers' => 'apps::apache::serverstatus::mode::workers'
|
||||||
);
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user