diff --git a/xCAT-client/bin/pping b/xCAT-client/bin/pping index 4bc3af11b..c5257d10a 100755 --- a/xCAT-client/bin/pping +++ b/xCAT-client/bin/pping @@ -199,9 +199,10 @@ sub nmap_pping { @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions"); $more_options = $nmap_options[0]; } - open(FPING, "nmap -PE --system-dns --unprivileged --send-ip -sP $more_options " . join(' ', @$nodes) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); + # Added port 22 for unprivileged case (#4324) + open(NMAP, "nmap -PE --system-dns --send-ip -sP --unprivileged -PA80,443,22 $more_options " . join(' ', @$nodes) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!"); my $node; - while () { + while () { if (/Host (.*) \(.*\) appears to be up/) { $node = $1; unless ($deadnodes{$node}) { diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index 7486aae58..bdea53303 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -658,7 +658,7 @@ sub process_request_nmap { if ($ip6 and scalar(@ip6s)) { open($fping, "nmap --unprivileged -6 -PS$ports,3001 -n --send-ip -p $ports,3001 $more_options " . join(' ', @ip6s) . " 2> /dev/null|") or die("Can't start nmap: $!"); } elsif (not $ip6 and scalar(@ips)) { - open($fping, "nmap --unprivileged -PE -n --send-ip -p $ports,3001 $more_options " . join(' ', @ips) . " 2> /dev/null|") or die("Can't start nmap: $!"); + open($fping, "nmap --unprivileged -PA80,443,22 -PE -n --send-ip -p $ports,3001 $more_options " . join(' ', @ips) . " 2> /dev/null|") or die("Can't start nmap: $!"); } else { next; } while (<$fping>) { if (/Interesting ports on ([^ ]*)[: ]/ or /Nmap scan report for ([^ ]*)/) {