diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-01-17 21:27:00 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-01-17 21:27:00 +0000 |
commit | 35e523d027350126794c1be64e23ea298084270d (patch) | |
tree | 86f253481b1c062ff9fa65214276a979aecf8aab | |
parent | b58828f90df8ee107aff3a468139430aaaa92e15 (diff) | |
download | sitesummary-35e523d027350126794c1be64e23ea298084270d.tar.gz sitesummary-35e523d027350126794c1be64e23ea298084270d.tar.bz2 sitesummary-35e523d027350126794c1be64e23ea298084270d.tar.xz |
Improve structure in generated Nagios config.
-rwxr-xr-x | sitesummary-nodes | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes index e8ea3d4..617365a 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -165,6 +165,8 @@ sub print_nagios_host_check { my ($hostname, $address) = @_; my $template = "server-host"; print <<EOF; +##################### $hostname ####################### + define host { use $template host_name $hostname @@ -189,10 +191,6 @@ sub generate_nagios_config { my $defaultroute = gethostbyaddr(inet_aton(get_default_route($hostid)), AF_INET); - print <<EOF; -##################### $hostname ####################### -EOF - # Also check default route host if (defined $defaultroute && !exists $hosts{$defaultroute}) { print_nagios_host_check($defaultroute, $defaultroute); |