From 5e686b1a458679fd95fa1e288b0b7427eeb83d22 Mon Sep 17 00:00:00 2001 From: yinle Date: Tue, 28 Jan 2014 13:38:39 -0800 Subject: [PATCH] Add range check and message to nmap --- perl-xCAT/xCAT/SLP.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/SLP.pm b/perl-xCAT/xCAT/SLP.pm index e1ebae53b..dfde2d620 100755 --- a/perl-xCAT/xCAT/SLP.pm +++ b/perl-xCAT/xCAT/SLP.pm @@ -110,6 +110,12 @@ sub dodiscover { my @servernodes; my @iprange = split /,/, $ipranges; foreach my $range (@iprange) { + send_message($args{reqcallback}, 0, "Processing range $range..."); + if ($range =~/\/(\d+)/){ + if ($1 > 16) { + send_message($args{reqcallback}, 0, "The rarge is too large and may be time consuming. Broadcast is recommended."); + } + } `/usr/bin/nmap $range -sn -PE -n --send-ip -T5 `; my $nmapres = `/usr/bin/nmap $range -PE -p 427 -n --send-ip -T5 `; foreach my $line (split(/\n\n/,$nmapres)) { @@ -233,7 +239,7 @@ sub dodiscover { close PWRITE; if (@servernodes) { my $miss = join(",", @servernodes); - send_message($args{reqcallback}, 0, "Warning: can't got attributes from these nodes' replies: $miss. Please re-send unicast to these nodes.") if ($args{reqcallback}); + send_message($args{reqcallback}, 0, "Warning: can't get attributes from these nodes' replies: $miss. Please re-send unicast to these nodes.") if ($args{reqcallback}); } }# end of parent process } else {