# Now go through each host, and fill in the table.
foreach $host ( $self->hosts() ) {
- my $hostname = $host->name();
- if ( ! $main::WWW_FQDN ) { # If WWW_FQDN not set, use short hostname
- my $short = $main::HOSTS{$hostname}->{'display_name'};
- $short = (split( /\./, $hostname ))[0] unless $short;
- $hostname = $short;
+ my $hostname = $host->name();
+ # Use display-name attrib if defined
+ my $display = $main::HOSTS{$hostname}->{'display_name'};
+ if ( ! $display ) {
+ # Otherwise use the hostname if $WWW_FQDN or short name
+ $display = $main::WWW_FQDN ? $hostname :
+ (split( /\./, $hostname ))[0];
}
-
print "<tr><td align=left bgcolor=#ffffff nowrap>\n";
- print "<a href=\"!!WWWSPONG!!/host/$hostname\">$hostname</a></td>\n";
+ print "<a href=\"!!WWWSPONG!!/host/$hostname\">$display</a></td>\n";
foreach $service ( @names ) {
my $servobj = $host->service( $service );