mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-04 10:35:12 +00:00
@@ -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 (<FPING>) {
|
||||
while (<NMAP>) {
|
||||
if (/Host (.*) \(.*\) appears to be up/) {
|
||||
$node = $1;
|
||||
unless ($deadnodes{$node}) {
|
||||
|
@@ -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 ([^ ]*)/) {
|
||||
|
Reference in New Issue
Block a user