diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2008-06-01 07:46:51 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2008-06-01 07:46:51 +0000 |
commit | 3ae0fc705695dc63214d3b18c0ef8e3fec017277 (patch) | |
tree | 2fd31d78409d8788d9d1bf3442c7c982596a73a8 /sitesummary-nodes | |
parent | 5db80a24a94e4361f80d591db2bb4a2e74c8d4cf (diff) | |
download | sitesummary-3ae0fc705695dc63214d3b18c0ef8e3fec017277.tar.gz sitesummary-3ae0fc705695dc63214d3b18c0ef8e3fec017277.tar.bz2 sitesummary-3ae0fc705695dc63214d3b18c0ef8e3fec017277.tar.xz |
- Use the IP address from ifconfig, not the sitesummary peer address,
when generating nagios configuration, to avoid using the web proxy IP
address.
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-x | sitesummary-nodes | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes index 013be62..1dbe7d9 100755 --- a/sitesummary-nodes +++ b/sitesummary-nodes @@ -32,12 +32,8 @@ sub in_dns { sub handle_host { my $hostid = shift; - my $hostname = get_hostname($hostid); - # Use IP address as hostname if the provided hostname is bogus or - # missing in DNS. - $hostname = get_primary_ip_address($hostid) - if (! in_dns($hostname) || "localhost" eq $hostname); - $hostnames{$hostname} = $hostid; + my $address = get_dns_hostname($hostid); + $hostnames{$address} = $hostid; } sub print_list { @@ -95,11 +91,7 @@ sub generate_nagios_config { my $hostid = $hostnames{$hostname}; next unless (is_nagios_client($hostid)); - my $ifconfigpath = get_filepath_current($hostid, "/system/ifconfig-a"); - my $peerinfopath = get_filepath_current($hostid, "/peerinfo"); - open (F, "<", $peerinfopath)||die "Unable to read from $peerinfopath"; - my ($address) = split(/\s+/, scalar <F>); - close(F); + my $address = get_dns_address($hostid); # first, check ping to see if the other checks should be performed print <<EOF; |