aboutsummaryrefslogtreecommitdiffstats
path: root/sitesummary-nodes
diff options
context:
space:
mode:
Diffstat (limited to 'sitesummary-nodes')
-rwxr-xr-xsitesummary-nodes17
1 files changed, 16 insertions, 1 deletions
diff --git a/sitesummary-nodes b/sitesummary-nodes
index 2d235c7..013be62 100755
--- a/sitesummary-nodes
+++ b/sitesummary-nodes
@@ -24,9 +24,19 @@ if ($opts{'m'}) {
print_list();
}
+sub in_dns {
+ my $hostname = shift;
+ my $packed_ip = gethostbyname($hostname);
+ return defined $packed_ip;
+}
+
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;
}
@@ -155,11 +165,16 @@ EOF
my ($dev, $partition, $fs, $opts) = split;
next if (exists $checked{$partition});
next if ($fs eq "devpts" ||
+ $fs eq "autofs" ||
+ $fs eq "binfmt_misc" ||
+ $fs eq "iso9660" ||
+ $fs eq "nfsd" ||
$fs eq "proc" ||
$fs eq "rootfs" ||
$fs eq "rpc_pipefs" ||
$fs eq "sysfs" ||
- $fs eq "tmpfs");
+ $fs eq "tmpfs" ||
+ $fs eq "usbfs");
$checked{$partition} = 1;
my $warn = 10;