aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-nodes
diff options
context:
space:
mode:
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-xsitesummary-nodes13
1 files changed, 9 insertions, 4 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes
index fd6be45..e8695ac 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -398,10 +398,15 @@ sub generate_nagios_config {
"check_imaps")
if is_pkg_installed($hostid, "courier-imap-ssl");
- # check software raid status
- if ( -e get_filepath_current($hostid, "/system/mdstat") ) {
- print_nagios_service_check($remote, $hostname, "sw-raid",
- "check_linux_raid");
+ # check software raid status if any is active
+ if ( -e get_filepath_current($hostid, "/system/mdstat")) {
+ my $fh;
+ if (open($fh, get_filepath_current($hostid, "/system/mdstat")) &&
+ grep(/^md\d+ :/, <$fh>)) {
+ print_nagios_service_check($remote, $hostname, "sw-raid",
+ "check_linux_raid");
+ }
+ close($fh);
}
# Check NFS server