mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-31 01:24:35 +02:00
+ Take also success flag into account, not only assertions
This commit is contained in:
parent
a3550c580b
commit
b9478ec686
@ -114,15 +114,21 @@ sub run {
|
|||||||
|
|
||||||
my $elapsed_time = $httpSampleNode->getAttribute('t');
|
my $elapsed_time = $httpSampleNode->getAttribute('t');
|
||||||
my $timestamp = $httpSampleNode->getAttribute('ts');
|
my $timestamp = $httpSampleNode->getAttribute('ts');
|
||||||
|
my $success = $httpSampleNode->getAttribute('s');
|
||||||
my $label = $httpSampleNode->getAttribute('lb');
|
my $label = $httpSampleNode->getAttribute('lb');
|
||||||
my $response_code = $httpSampleNode->getAttribute('rc');
|
my $response_code = $httpSampleNode->getAttribute('rc');
|
||||||
my $response_message = $httpSampleNode->getAttribute('rm');
|
my $response_message = $httpSampleNode->getAttribute('rm');
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => "* Sample: " . $label);
|
$self->{output}->output_add(long_msg => "* Sample: " . $label);
|
||||||
|
$self->{output}->output_add(long_msg => " - Success: " . $success);
|
||||||
$self->{output}->output_add(long_msg => " - Elapsed Time: " . $elapsed_time / 1000 . "s");
|
$self->{output}->output_add(long_msg => " - Elapsed Time: " . $elapsed_time / 1000 . "s");
|
||||||
$self->{output}->output_add(long_msg => " - Response Code: " . $response_code);
|
$self->{output}->output_add(long_msg => " - Response Code: " . $response_code);
|
||||||
$self->{output}->output_add(long_msg => " - Response Message: " . $response_message);
|
$self->{output}->output_add(long_msg => " - Response Message: " . $response_message);
|
||||||
|
|
||||||
|
if ($success ne 'true') {
|
||||||
|
$temp_exit = 'CRITICAL';
|
||||||
|
}
|
||||||
|
|
||||||
my $listAssertionResultNode = $xp->findnodes('./assertionResult', $httpSampleNode);
|
my $listAssertionResultNode = $xp->findnodes('./assertionResult', $httpSampleNode);
|
||||||
|
|
||||||
foreach my $assertionResultNode ($listAssertionResultNode->get_nodelist) {
|
foreach my $assertionResultNode ($listAssertionResultNode->get_nodelist) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user