# Version and similar info
$NAME = 'check_openmanage';
-$VERSION = '3.5.0-beta14';
+$VERSION = '3.5.0-beta18';
$AUTHOR = 'Trond H. Amundsen';
$CONTACT = 't.h.amundsen@usit.uio.no';
OMREPORT_PATH:
foreach my $bin (@omreport_paths) {
if (-x $bin) {
- $omreport = $bin;
+ $omreport = qq{"$bin"};
last OMREPORT_PATH;
}
}
if (defined $blacklist{$name}) {
foreach my $comp (@{ $blacklist{$name} }) {
- if (defined $id and $comp eq $id) {
+ if (defined $id and ($comp eq $id or $comp eq 'ALL')) {
$ret = 1;
}
}
# Special case: Charging
if ($state eq 'Charging') {
+ next BATTERY if blacklisted('bat_charge', $nexus);
my $msg = sprintf 'Cache battery %d in controller %d is %s (%s) [probably harmless]',
$id, $ctrl, $state, $pred;
report('storage', $msg, $E_WARNING, $nexus);
}
# Special case: Learning (battery learns its capacity)
elsif ($state eq 'Learning') {
+ next BATTERY if blacklisted('bat_charge', $nexus);
my $msg = sprintf 'Cache battery %d in controller %d is %s (%s) [probably harmless]',
$id, $ctrl, $state, $learn;
report('storage', $msg, $E_WARNING, $nexus);
}
# Special case: Power Low (first part of recharge cycle)
elsif ($state eq 'Power Low') {
+ next BATTERY if blacklisted('bat_charge', $nexus);
my $msg = sprintf 'Cache battery %d in controller %d is %s [probably harmless]',
$id, $ctrl, $state;
report('storage', $msg, $E_WARNING, $nexus);
}
+ # Special case: Degraded and Non-Critical (usually part of recharge cycle)
+ elsif ($state eq 'Degraded' && $status eq 'Non-Critical') {
+ next BATTERY if blacklisted('bat_charge', $nexus);
+ my $msg = sprintf 'Cache battery %d in controller %d is %s (%s) [probably harmless]',
+ $id, $ctrl, $state, $status;
+ report('storage', $msg, $E_WARNING, $nexus);
+ }
# Default
elsif ($status ne 'Ok') {
my $msg = sprintf 'Cache battery %d in controller %d needs attention: %s (%s)',
$max_crit =~ s{\A (\d+.*?)\s+[a-zA-Z]+ \s*\z}{$1}xms;
}
- next AMP if blacklisted('pm', $index);
+ next AMP if blacklisted('amp', $index);
next AMP if $index !~ m{\A \d+ \z}xms;
$count{amp}++;