From 6f1e0bdab9e642123dc6fda8f03cbc6d4f1d8280 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 26 Sep 2017 14:25:27 -0400 Subject: [PATCH 1/2] If the openbmc console port is returned by nmap, assume that it's openbmc --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 4264f519d..f25f29851 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -670,7 +670,8 @@ sub scan_process { my $nmap_cmd = "nmap ${$live_ip}[$i] -p $openbmc_port -Pn"; my $nmap_output = xCAT::Utils->runcmd($nmap_cmd, -1); - if ($nmap_output =~ /$openbmc_port(.+)open/) { + if ($nmap_output =~ /$openbmc_port(.+)/) { + # if the openbmc_port exists at any nmap status, assume it's an OpenBMC server bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command); } else { bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command); From df6209c381321b9a5136586cd0c2fd08524a6a20 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 3 Oct 2017 14:01:07 -0400 Subject: [PATCH 2/2] Instead of testing for open, test if NOT closed,then OpenBMC --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index f25f29851..27defb307 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -670,8 +670,8 @@ sub scan_process { my $nmap_cmd = "nmap ${$live_ip}[$i] -p $openbmc_port -Pn"; my $nmap_output = xCAT::Utils->runcmd($nmap_cmd, -1); - if ($nmap_output =~ /$openbmc_port(.+)/) { - # if the openbmc_port exists at any nmap status, assume it's an OpenBMC server + if ($nmap_output !~ /$openbmc_port(.+)closed/) { + # If the openbmc_port is anything execpt 'closed' assume it's OpenBMC server bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command); } else { bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command);