mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
parent
3abed0bb3f
commit
e20eefcf07
@ -98,7 +98,6 @@ sub run {
|
|||||||
browser_url => $baseurl
|
browser_url => $baseurl
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$sel->start;
|
$sel->start;
|
||||||
|
|
||||||
my $timing0 = [gettimeofday];
|
my $timing0 = [gettimeofday];
|
||||||
@ -106,7 +105,6 @@ sub run {
|
|||||||
my $step = $listActionNode->get_nodelist;
|
my $step = $listActionNode->get_nodelist;
|
||||||
my $stepOk = 0;
|
my $stepOk = 0;
|
||||||
my $exit1 = 'UNKNOWN';
|
my $exit1 = 'UNKNOWN';
|
||||||
|
|
||||||
foreach my $actionNode ($listActionNode->get_nodelist) {
|
foreach my $actionNode ($listActionNode->get_nodelist) {
|
||||||
($action, $filter, $value) = $xp->find('./td', $actionNode)->get_nodelist;
|
($action, $filter, $value) = $xp->find('./td', $actionNode)->get_nodelist;
|
||||||
my $trim_action = centreon::plugins::misc::trim($action->string_value);
|
my $trim_action = centreon::plugins::misc::trim($action->string_value);
|
||||||
@ -138,30 +136,23 @@ sub run {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $timeelapsed = tv_interval ($timing0, [gettimeofday]);
|
my $timeelapsed = tv_interval ($timing0, [gettimeofday]);
|
||||||
|
|
||||||
my $availability = sprintf("%d", $stepOk * 100 / $step);
|
my $availability = sprintf("%d", $stepOk * 100 / $step);
|
||||||
|
|
||||||
|
|
||||||
my $exit2 = $self->{perfdata}->threshold_check(value => $timeelapsed,
|
my $exit2 = $self->{perfdata}->threshold_check(value => $timeelapsed,
|
||||||
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
|
|
||||||
my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]);
|
my $exit = $self->{output}->get_most_critical(status => [ $exit1, $exit2 ]);
|
||||||
$self->{output}->output_add(severity => $exit,
|
$self->{output}->output_add(severity => $exit,
|
||||||
short_msg => sprintf("%d/%d steps (%.3fs)", $stepOk, $step, $timeelapsed));
|
short_msg => sprintf("%d/%d steps (%.3fs)", $stepOk, $step, $timeelapsed));
|
||||||
$self->{output}->perfdata_add(label => "time",
|
$self->{output}->perfdata_add(label => "time", unit => 's',
|
||||||
value => sprintf('%.3f', $timeelapsed),
|
value => sprintf('%.3f', $timeelapsed),
|
||||||
unit => 's',
|
|
||||||
min => 0,
|
min => 0,
|
||||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
|
||||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'));
|
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'));
|
||||||
|
|
||||||
$self->{output}->perfdata_add(label => "steps",
|
$self->{output}->perfdata_add(label => "steps",
|
||||||
value => sprintf('%d', $stepOk),
|
value => sprintf('%d', $stepOk),
|
||||||
min => 0,
|
min => 0,
|
||||||
max => $step);
|
max => $step);
|
||||||
|
$self->{output}->perfdata_add(label => "availability", unit => '%',
|
||||||
$self->{output}->perfdata_add(label => "availability",
|
|
||||||
unit => '%',
|
|
||||||
value => sprintf('%d', $availability),
|
value => sprintf('%d', $availability),
|
||||||
min => 0,
|
min => 0,
|
||||||
max => 100);
|
max => 100);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user