Merge pull request #582 from cgagnaire/patch-1

Add verbose and regexp for stopped resources
This commit is contained in:
qgarnier 2017-01-20 14:08:15 +01:00 committed by GitHub
commit 5c322332b8
1 changed files with 5 additions and 3 deletions

View File

@ -102,11 +102,13 @@ sub parse_output {
# Check Resources pos # Check Resources pos
if (defined($self->{resources_check}->{$1}) && $self->{resources_check}->{$1} ne $2) { if (defined($self->{resources_check}->{$1}) && $self->{resources_check}->{$1} ne $2) {
$self->{output}->output_add(severity => $self->{threshold}, $self->{output}->output_add(severity => $self->{threshold},
short_msg => "Resource '$1' is on node '$2'"); short_msg => "Resource '$1' is started on node '$2'");
} }
} elsif ($line =~ /\s*([0-9a-zA-Z_\-]+)\s+\(\S+\)\:\s+Stopped/) { $self->{output}->output_add(long_msg => "Resource '$1' is started on node '$2'");
} elsif ($line =~ /\s*([0-9a-zA-Z_\-]+)\s+\(\S+\)\:\s+Stopped/ || $line =~ /\s*([0-9a-zA-Z_\-]+)\s+\(\S+\)\:\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' is stopped",
long_msg => "Resource '$1' is stopped");
} elsif ($line =~ m/\s*stopped\:\s*\[\s*(.*)\s*\]/i) { } elsif ($line =~ m/\s*stopped\:\s*\[\s*(.*)\s*\]/i) {
# Check Master/Slave stopped # Check Master/Slave stopped
my @stopped = (); my @stopped = ();