aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rwxr-xr-xsitesummary-nodes5
2 files changed, 12 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index ae69533..5732bb1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+sitesummary (0.1.6) UNRELEASED; urgency=low
+
+ * Make Nagios config more robust, ignore hosts without any name and
+ address, which must be the result of a corrupt sitesummary entry.
+
+ -- Petter Reinholdtsen <pere@debian.org> Fri, 31 Aug 2012 11:00:04 +0200
+
sitesummary (0.1.5) unstable; urgency=low
* Team upload.
diff --git a/sitesummary-nodes b/sitesummary-nodes
index ab2ecf1..fb27d57 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -251,6 +251,11 @@ sub generate_nagios_config {
my $address = get_dns_address($hostid);
my $localhostname = get_localhostname($hostid);
+ unless (defined $address && defined $localhostname) {
+ print "# Skipping ID $hostid without hostname and address\n";
+ next;
+ }
+
my $redirect = "";
my $nagiosclient = is_nagios_client($hostid);
my $remote = is_remote_nagios_client($hostid);