mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-26 23:24:27 +02:00
+ Change option in crm mode to skip failed action
This commit is contained in:
parent
2df58721f7
commit
cac2103248
@ -61,7 +61,7 @@ sub new {
|
|||||||
"warning" => { name => 'warning', },
|
"warning" => { name => 'warning', },
|
||||||
"standbyignore" => { name => 'standbyignore', },
|
"standbyignore" => { name => 'standbyignore', },
|
||||||
"resources:s" => { name => 'resources', },
|
"resources:s" => { name => 'resources', },
|
||||||
"ignore-failed-actions" => { name => 'ignore_failed_actions', },
|
"ignore-failed-actions:s@" => { name => 'ignore_failed_actions', },
|
||||||
});
|
});
|
||||||
$self->{threshold} = 'CRITICAL';
|
$self->{threshold} = 'CRITICAL';
|
||||||
$self->{resources_check} = {};
|
$self->{resources_check} = {};
|
||||||
@ -123,8 +123,17 @@ sub parse_output {
|
|||||||
# Check Master/Slave stopped
|
# Check Master/Slave stopped
|
||||||
$self->{output}->output_add(severity => $self->{threshold},
|
$self->{output}->output_add(severity => $self->{threshold},
|
||||||
short_msg => "$1 Stopped");
|
short_msg => "$1 Stopped");
|
||||||
} elsif ($line =~ /^Failed actions\:/ && !defined($self->{option_results}->{ignore_failed_actions})) {
|
} elsif ($line =~ /^Failed actions\:/) { && !defined($self->{option_results}->{ignore_failed_actions})) {
|
||||||
# Check Failed Actions
|
# Check Failed Actions
|
||||||
|
my $skip = 0;
|
||||||
|
foreach ($self->{option_results}->{ignore_failed_actions}) {
|
||||||
|
if ($line =~ /$_/) {
|
||||||
|
$skip = 1;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
next if ($skip == 1);
|
||||||
|
|
||||||
$self->{output}->output_add(severity => 'CRITICAL',
|
$self->{output}->output_add(severity => 'CRITICAL',
|
||||||
short_msg => "FAILED actions detected or not cleaned up");
|
short_msg => "FAILED actions detected or not cleaned up");
|
||||||
} elsif ($line =~ /\s*(\S+?)\s+ \(.*\)\:\s+\w+\s+\w+\s+\(unmanaged\)\s+FAILED/) {
|
} elsif ($line =~ /\s*(\S+?)\s+ \(.*\)\:\s+\w+\s+\w+\s+\(unmanaged\)\s+FAILED/) {
|
||||||
@ -190,7 +199,7 @@ If resources not started on the node specified, send a warning message:
|
|||||||
|
|
||||||
=item B<--ignore-failed-actions>
|
=item B<--ignore-failed-actions>
|
||||||
|
|
||||||
Failed actions errors are skipped.
|
Failed actions errors (that match) are skipped.
|
||||||
|
|
||||||
=item B<--remote>
|
=item B<--remote>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user