diff options
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; |