Fix 2537 (#2593)
This commit is contained in:
parent
5f0871b819
commit
05ecf15344
|
@ -65,11 +65,12 @@ sub custom_value_output {
|
|||
|
||||
my $label = $self->{result_values}->{label};
|
||||
$label =~ s/_/ /g;
|
||||
$label =~ s/(\w+)/\u$1/g;
|
||||
my $msg = sprintf("%s : %s (%.2f %%)",
|
||||
ucfirst($label),
|
||||
$self->{result_values}->{used}, $self->{result_values}->{prct});
|
||||
return $msg;
|
||||
return sprintf(
|
||||
"%s: %s (%.2f %%)",
|
||||
$label,
|
||||
$self->{result_values}->{used},
|
||||
$self->{result_values}->{prct}
|
||||
);
|
||||
}
|
||||
|
||||
sub custom_value_calc {
|
||||
|
@ -200,17 +201,17 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
"hostname:s" => { name => 'hostname' },
|
||||
"port:s" => { name => 'port', },
|
||||
"proto:s" => { name => 'proto' },
|
||||
"urlpath:s" => { name => 'url_path', default => "/server-status/?auto" },
|
||||
"credentials" => { name => 'credentials' },
|
||||
"basic" => { name => 'basic' },
|
||||
"username:s" => { name => 'username' },
|
||||
"password:s" => { name => 'password' },
|
||||
"header:s@" => { name => 'header' },
|
||||
"timeout:s" => { name => 'timeout' },
|
||||
"units:s" => { name => 'units', default => '%' },
|
||||
'hostname:s' => { name => 'hostname' },
|
||||
'port:s' => { name => 'port', },
|
||||
'proto:s' => { name => 'proto' },
|
||||
'urlpath:s' => { name => 'url_path', default => "/server-status/?auto" },
|
||||
'credentials' => { name => 'credentials' },
|
||||
'basic' => { name => 'basic' },
|
||||
'username:s' => { name => 'username' },
|
||||
'password:s' => { name => 'password' },
|
||||
'header:s@' => { name => 'header' },
|
||||
'timeout:s' => { name => 'timeout' },
|
||||
'units:s' => { name => 'units', default => '%' }
|
||||
});
|
||||
|
||||
$self->{http} = centreon::plugins::http->new(%options);
|
||||
|
@ -238,11 +239,11 @@ sub manage_selection {
|
|||
if ($webcontent =~ /^Scoreboard:\s+([^\s]+)/mi) {
|
||||
$ScoreBoard = $1;
|
||||
}
|
||||
|
||||
|
||||
$self->{global} = {
|
||||
total => length($ScoreBoard),
|
||||
free => ($ScoreBoard =~ tr/\.//),
|
||||
busy => length($ScoreBoard) - ($ScoreBoard =~ tr/\.//),
|
||||
free => ($ScoreBoard =~ tr/\.//) + ($ScoreBoard =~ tr/\_//),
|
||||
busy => length($ScoreBoard) - ($ScoreBoard =~ tr/\.//) - ($ScoreBoard =~ tr/\_//),
|
||||
waiting => ($ScoreBoard =~ tr/\_//), starting => ($ScoreBoard =~ tr/S//),
|
||||
reading => ($ScoreBoard =~ tr/R//), sending => ($ScoreBoard =~ tr/W//),
|
||||
keepalive => ($ScoreBoard =~ tr/K//), dns_lookup => ($ScoreBoard =~ tr/D//),
|
||||
|
|
|
@ -30,13 +30,13 @@ sub new {
|
|||
bless $self, $class;
|
||||
|
||||
$self->{version} = '0.1';
|
||||
%{$self->{modes}} = (
|
||||
'cpuload' => 'apps::apache::serverstatus::mode::cpuload',
|
||||
'responsetime' => 'apps::apache::serverstatus::mode::responsetime',
|
||||
'requests' => 'apps::apache::serverstatus::mode::requests',
|
||||
'slotstates' => 'apps::apache::serverstatus::mode::slotstates',
|
||||
'workers' => 'apps::apache::serverstatus::mode::workers',
|
||||
);
|
||||
$self->{modes} = {
|
||||
'cpuload' => 'apps::apache::serverstatus::mode::cpuload',
|
||||
'responsetime' => 'apps::apache::serverstatus::mode::responsetime',
|
||||
'requests' => 'apps::apache::serverstatus::mode::requests',
|
||||
'slotstates' => 'apps::apache::serverstatus::mode::slotstates',
|
||||
'workers' => 'apps::apache::serverstatus::mode::workers'
|
||||
};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue