aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2011-12-23 12:47:15 +0000
committerPetter Reinholdtsen <pere@hungry.com>2011-12-23 12:47:15 +0000
commit0de7b890f5114895d9c72849b59da11511b8fa50 (patch)
treed45c99ce368103d1069d34ba3ff55d79ebb1bcd9
parent0a0b4ed5b75d5423ef5ec96a8b04781f758afddf (diff)
downloadsitesummary-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.
-rw-r--r--debian/changelog6
-rwxr-xr-xsitesummary-nodes13
2 files changed, 13 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index 98a7d8b..e82d28d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,8 +2,10 @@ sitesummary (0.0.74) UNRELEASED; urgency=low
* Add munin include dir to default munin config to match recent
munin versions.
- * Ignore devtmpfs in Nagios configuration, the same way tmpfs is
- ignored.
+ * Autogenerated Nagios configuration:
+ - Ignore devtmpfs, the same way tmpfs is ignored.
+ - Only check Linux software RAID if a RAID is enabled and not only
+ when /proc/mdstat is present.
-- Petter Reinholdtsen <pere@debian.org> Thu, 22 Dec 2011 18:52:10 +0100
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