diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2011-12-23 12:47:15 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2011-12-23 12:47:15 +0000 |
commit | 0de7b890f5114895d9c72849b59da11511b8fa50 (patch) | |
tree | d45c99ce368103d1069d34ba3ff55d79ebb1bcd9 /sitesummary-nodes | |
parent | 0a0b4ed5b75d5423ef5ec96a8b04781f758afddf (diff) | |
download | sitesummary-0de7b890f5114895d9c72849b59da11511b8fa50.tar.gz sitesummary-0de7b890f5114895d9c72849b59da11511b8fa50.tar.bz2 sitesummary-0de7b890f5114895d9c72849b59da11511b8fa50.tar.xz |
In Nagios configuration, only check for software raid when it is enabled, instead of just when /proc/mdstat is present.
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-x | sitesummary-nodes | 13 |
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 |