mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
Merge branch 'master' of http://git.centreon.com/centreon-plugins
This commit is contained in:
commit
56efc4407c
@ -62,6 +62,7 @@ sub new {
|
|||||||
"warning" => { name => 'warning', },
|
"warning" => { name => 'warning', },
|
||||||
"standbyignore" => { name => 'standbyignore', },
|
"standbyignore" => { name => 'standbyignore', },
|
||||||
"resources:s" => { name => 'resources', },
|
"resources:s" => { name => 'resources', },
|
||||||
|
"ignore-stopped-clone:s" => { name => 'ignore_stopped_clone', },
|
||||||
"ignore-failed-actions:s@" => { name => 'ignore_failed_actions', },
|
"ignore-failed-actions:s@" => { name => 'ignore_failed_actions', },
|
||||||
});
|
});
|
||||||
$self->{threshold} = 'CRITICAL';
|
$self->{threshold} = 'CRITICAL';
|
||||||
@ -121,10 +122,19 @@ sub parse_output {
|
|||||||
} elsif ($line =~ /\s*([0-9a-zA-Z_\-]+)\s+\(\S+\)\:\s+Stopped/) {
|
} elsif ($line =~ /\s*([0-9a-zA-Z_\-]+)\s+\(\S+\)\:\s+Stopped/) {
|
||||||
$self->{output}->output_add(severity => $self->{threshold},
|
$self->{output}->output_add(severity => $self->{threshold},
|
||||||
short_msg => "Resource '$1' Stopped");
|
short_msg => "Resource '$1' Stopped");
|
||||||
} elsif ($line =~ m/\s*stopped\:\s*\[(.*)\]/i) {
|
} elsif ($line =~ m/\s*stopped\:\s*\[\s*(.*)\s*\]/i) {
|
||||||
# Check Master/Slave stopped
|
# Check Master/Slave stopped
|
||||||
|
my @stopped = ();
|
||||||
|
foreach my $node (split /\s+/, $1) {
|
||||||
|
if (!defined($self->{option_results}->{ignore_stopped_clone}) || $self->{option_results}->{ignore_stopped_clone} eq '' ||
|
||||||
|
$node !~ /$self->{option_results}->{ignore_stopped_clone}/) {
|
||||||
|
push @stopped, $node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (scalar(@stopped) > 0) {
|
||||||
$self->{output}->output_add(severity => $self->{threshold},
|
$self->{output}->output_add(severity => $self->{threshold},
|
||||||
short_msg => "$1 Stopped");
|
short_msg => join(' ', @stopped) . " Stopped");
|
||||||
|
}
|
||||||
} elsif ($line =~ /^Failed actions\:/) {
|
} elsif ($line =~ /^Failed actions\:/) {
|
||||||
# Check Failed Actions
|
# Check Failed Actions
|
||||||
my $error = 0;
|
my $error = 0;
|
||||||
@ -202,6 +212,10 @@ Ignore any node(s) in standby, by default return threshold choosen.
|
|||||||
If resources not started on the node specified, send a warning message:
|
If resources not started on the node specified, send a warning message:
|
||||||
(format: <rsc_name>:<node>,<rsc_name>:<node>,...)
|
(format: <rsc_name>:<node>,<rsc_name>:<node>,...)
|
||||||
|
|
||||||
|
=item B<--ignore-stopped-clone>
|
||||||
|
|
||||||
|
Stopped clone resource on nodes (that match) are skipped.
|
||||||
|
|
||||||
=item B<--ignore-failed-actions>
|
=item B<--ignore-failed-actions>
|
||||||
|
|
||||||
Failed actions errors (that match) are skipped.
|
Failed actions errors (that match) are skipped.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user