aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2012-01-17 17:58:55 +0000
committerPetter Reinholdtsen <pere@hungry.com>2012-01-17 17:58:55 +0000
commit511cb1fe551e77a53685f8fc80a7ecab8f6a19a4 (patch)
treeac94f56948d0a0b71fe738d1c7e32e3ee462113e
parent14c968288879b2f7acae54f6cd49f888e6517fb0 (diff)
downloadsitesummary-511cb1fe551e77a53685f8fc80a7ecab8f6a19a4.tar.gz
sitesummary-511cb1fe551e77a53685f8fc80a7ecab8f6a19a4.tar.bz2
sitesummary-511cb1fe551e77a53685f8fc80a7ecab8f6a19a4.tar.xz
Limit Nagios monitoring to hosts in DNS, unless the Nagios client
tools are installed, to avoid monitoring machines before they are configured.
-rw-r--r--debian/changelog3
-rwxr-xr-xsitesummary-nodes7
2 files changed, 10 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 85e4f4a..e753c1b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ sitesummary (0.1.1~svn74458) UNRELEASED; urgency=low
* Raise Nagios user (w20,c50 to w150,c200) and process limits
(w500,c1000 to w1500,c2500) on LTSP servers, as these normally
will have lots of users and processes.
+ * Limit Nagios monitoring to hosts in DNS, unless the Nagios client
+ tools are installed, to avoid monitoring machines before they are
+ configured.
-- Petter Reinholdtsen <pere@debian.org> Tue, 17 Jan 2012 09:53:13 +0100
diff --git a/sitesummary-nodes b/sitesummary-nodes
index f52b8c7..eb2f599 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -249,6 +249,13 @@ sub generate_nagios_config {
next;
}
+ # Only check hosts missing in DNS if they have the nagios
+ # tools installed.
+ if ($hostname =~ m/^[\d\.:]+$/ && ! $remote && ! $nagiosclient) {
+ print "# Skipping host $hostname missing in DNS\n";
+ next;
+ }
+
my $site = get_site($hostid) || "none";
my $sitegroup = get_sitegroup($hostid);
my $debversion = get_debian_ver($hostid);