version 1.5, 2006/05/02 20:49:29 |
version 1.6, 2006/05/02 20:59:47 |
|
|
#!/usr/bin/perl |
#!/usr/bin/perl |
# $RedRiver: check_hw_sensors,v 1.4 2006/05/02 15:54:42 andrew Exp $ |
# $RedRiver: check_hw_sensors,v 1.5 2006/05/02 19:49:29 andrew Exp $ |
######################################################################## |
######################################################################## |
# check_hw_sensors *** A nagios check for OpenBSD hw.sensors |
# check_hw_sensors *** A nagios check for OpenBSD hw.sensors |
# |
# |
|
|
foreach my $error (sort { $ERRORS{$b} <=> $ERRORS{$a} } keys %ERRORS) { |
foreach my $error (sort { $ERRORS{$b} <=> $ERRORS{$a} } keys %ERRORS) { |
if (exists $states{$error}) { |
if (exists $states{$error}) { |
if (NAGIOS_OUTPUT) { |
if (NAGIOS_OUTPUT) { |
print "<li>$error (" . scalar(@{ $states{ $error } }) . "):<ul>"; |
print "<li>$error (" . scalar(@{ $states{ $error } }) . ")"; |
unless ($error eq 'OK') { |
unless ($error eq 'OK') { |
|
print '<ul>'; |
foreach (@{ $states{ $error } }) { |
foreach (@{ $states{ $error } }) { |
print "<li>$_</li>"; |
print "<li>$_</li>"; |
} |
} |
|
print '</ul>'; |
} |
} |
print "</ul></li>" |
print "</li>" |
} else { |
} else { |
print "$error (" . scalar(@{ $states{ $error } }) . "):\n"; |
print "$error (" . scalar(@{ $states{ $error } }) . "):\n"; |
foreach (@{ $states{ $error } }) { |
foreach (@{ $states{ $error } }) { |