diff options
| author | Petter Reinholdtsen <pere@hungry.com> | 2011-11-14 20:35:57 +0000 |
|---|---|---|
| committer | Petter Reinholdtsen <pere@hungry.com> | 2011-11-14 20:35:57 +0000 |
| commit | 0ea0a7ebe8d225ae4c5a022548974a6075abab89 (patch) | |
| tree | 1a503a785fd256be2d0881abc4988991327e6614 /sitesummary-nodes | |
| parent | 2a17e8d820d3855bc74c4f09adf2928b35317476 (diff) | |
| download | sitesummary-0ea0a7ebe8d225ae4c5a022548974a6075abab89.tar.gz sitesummary-0ea0a7ebe8d225ae4c5a022548974a6075abab89.tar.bz2 sitesummary-0ea0a7ebe8d225ae4c5a022548974a6075abab89.tar.xz | |
Adjust sitesummary-nodes code for generating Nagios configuration
to avoid perl warnings when no default route is set for a host.
Diffstat (limited to 'sitesummary-nodes')
| -rwxr-xr-x | sitesummary-nodes | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes index 6bf5794..970bdfe 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -268,8 +268,10 @@ sub generate_nagios_config { for my $group ( @groups ) { $hostgroup{$group} = 1; } - - my $defaultroute = get_dnsnameorip(get_default_route($hostid)); + my $defaultrouteip = get_default_route($hostid); + my $defaultroute; + $defaultroute = get_dnsnameorip($defaultrouteip) + if defined $defaultroute; # Also check default route host if (defined $defaultroute && !exists $hosts{$defaultroute}) { |
