{"action":"created","comment":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/63636827","id":63636827,"diff_hunk":"@@ -455,7 +456,18 @@ sub scan_process{\n     # get live ip list\n     ###########################################################\n     if ( $method eq \"nmap\" ) {\n-        my $bcmd = join(\" \",$nmap_path,\" -sn -n $range | grep for |cut -d ' ' -f5 |tr -s '\\n' ' ' \");\n+        #check nmap version first\n+        my $ccmd = \"$nmap_path -V | grep version\";\n+        my $version_result = xCAT::Utils->runcmd($ccmd, 0);\n+        my @version_array = split / /, $version_result;\n+        my $nmap_version = $version_array[2];\n+        # the output of nmap is different for version under 4.75","path":"xCAT-server/lib/xcat/plugins/bmcdiscover.pm","position":18,"original_position":18,"commit_id":"abbd1817acf7ddcfee188f944b0eff5e09ca6b24","original_commit_id":"abbd1817acf7ddcfee188f944b0eff5e09ca6b24","user":{"login":"zet809","id":8222144,"avatar_url":"https://avatars.githubusercontent.com/u/8222144?v=3","gravatar_id":"","url":"https://api.github.com/users/zet809","html_url":"https://github.com/zet809","followers_url":"https://api.github.com/users/zet809/followers","following_url":"https://api.github.com/users/zet809/following{/other_user}","gists_url":"https://api.github.com/users/zet809/gists{/gist_id}","starred_url":"https://api.github.com/users/zet809/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zet809/subscriptions","organizations_url":"https://api.github.com/users/zet809/orgs","repos_url":"https://api.github.com/users/zet809/repos","events_url":"https://api.github.com/users/zet809/events{/privacy}","received_events_url":"https://api.github.com/users/zet809/received_events","type":"User","site_admin":false},"body":"In fact, from https://nmap.org/changelog.html#5.10BETA1, it shows that from nmap 5.10,  the option -sP is replaced with -sn\r\nSo, 4.75 shall be replaced with (< 5.10) here.","created_at":"2016-05-18T02:24:07Z","updated_at":"2016-05-18T02:24:07Z","html_url":"https://github.com/xcat2/xcat-core/pull/1134#discussion_r63636827","pull_request_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134","_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments/63636827"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/1134#discussion_r63636827"},"pull_request":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134"}}},"pull_request":{"url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134","id":70423324,"html_url":"https://github.com/xcat2/xcat-core/pull/1134","diff_url":"https://github.com/xcat2/xcat-core/pull/1134.diff","patch_url":"https://github.com/xcat2/xcat-core/pull/1134.patch","issue_url":"https://api.github.com/repos/xcat2/xcat-core/issues/1134","number":1134,"state":"open","locked":false,"title":"Support lower version of nmap on sles11.4","user":{"login":"cxhong","id":12398836,"avatar_url":"https://avatars.githubusercontent.com/u/12398836?v=3","gravatar_id":"","url":"https://api.github.com/users/cxhong","html_url":"https://github.com/cxhong","followers_url":"https://api.github.com/users/cxhong/followers","following_url":"https://api.github.com/users/cxhong/following{/other_user}","gists_url":"https://api.github.com/users/cxhong/gists{/gist_id}","starred_url":"https://api.github.com/users/cxhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxhong/subscriptions","organizations_url":"https://api.github.com/users/cxhong/orgs","repos_url":"https://api.github.com/users/cxhong/repos","events_url":"https://api.github.com/users/cxhong/events{/privacy}","received_events_url":"https://api.github.com/users/cxhong/received_events","type":"User","site_admin":false},"body":"for issue #1120 ,  for bmcdiscover command, it will call nmap to discovery host ip address.  on sles11.4, nmap has lower version 4.75 than other OS,  it used nmap -sP instead of nmap -sn for scan Host.   the output of this command is also different.\r\n\r\non sles11.4:\r\n````\r\n # nmap -sP -n 10.4.30.254\r\n\r\nStarting Nmap 4.75 ( http://nmap.org ) at 2016-05-17 20:15 EDT\r\nHost 10.4.30.254 appears to be up.\r\nMAC Address: 34:40:B5:B9:BA:D7 (Unknown)\r\nNmap done: 1 IP address (1 host up) scanned in 0.52 seconds\r\n``````\r\n\r\non redhat:\r\n````\r\n# nmap -sn -n 10.4.30.254\r\n\r\nStarting Nmap 6.40 ( http://nmap.org ) at 2016-05-17 16:14 EDT\r\nNmap scan report for 10.4.30.254\r\nHost is up (0.00033s latency).\r\nMAC Address: 34:40:B5:B9:BA:D7 (IBM)\r\nNmap done: 1 IP address (1 host up) scanned in 0.39 seconds\r\n````","created_at":"2016-05-17T20:20:49Z","updated_at":"2016-05-18T02:24:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"641b67d274c1635f1e21512f4f44178eb089f55a","assignee":{"login":"whowutwut","id":10049070,"avatar_url":"https://avatars.githubusercontent.com/u/10049070?v=3","gravatar_id":"","url":"https://api.github.com/users/whowutwut","html_url":"https://github.com/whowutwut","followers_url":"https://api.github.com/users/whowutwut/followers","following_url":"https://api.github.com/users/whowutwut/following{/other_user}","gists_url":"https://api.github.com/users/whowutwut/gists{/gist_id}","starred_url":"https://api.github.com/users/whowutwut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whowutwut/subscriptions","organizations_url":"https://api.github.com/users/whowutwut/orgs","repos_url":"https://api.github.com/users/whowutwut/repos","events_url":"https://api.github.com/users/whowutwut/events{/privacy}","received_events_url":"https://api.github.com/users/whowutwut/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134/commits","review_comments_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134/comments","review_comment_url":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/issues/1134/comments","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/abbd1817acf7ddcfee188f944b0eff5e09ca6b24","head":{"label":"cxhong:1120","ref":"1120","sha":"abbd1817acf7ddcfee188f944b0eff5e09ca6b24","user":{"login":"cxhong","id":12398836,"avatar_url":"https://avatars.githubusercontent.com/u/12398836?v=3","gravatar_id":"","url":"https://api.github.com/users/cxhong","html_url":"https://github.com/cxhong","followers_url":"https://api.github.com/users/cxhong/followers","following_url":"https://api.github.com/users/cxhong/following{/other_user}","gists_url":"https://api.github.com/users/cxhong/gists{/gist_id}","starred_url":"https://api.github.com/users/cxhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxhong/subscriptions","organizations_url":"https://api.github.com/users/cxhong/orgs","repos_url":"https://api.github.com/users/cxhong/repos","events_url":"https://api.github.com/users/cxhong/events{/privacy}","received_events_url":"https://api.github.com/users/cxhong/received_events","type":"User","site_admin":false},"repo":{"id":41100712,"name":"xcat-core","full_name":"cxhong/xcat-core","owner":{"login":"cxhong","id":12398836,"avatar_url":"https://avatars.githubusercontent.com/u/12398836?v=3","gravatar_id":"","url":"https://api.github.com/users/cxhong","html_url":"https://github.com/cxhong","followers_url":"https://api.github.com/users/cxhong/followers","following_url":"https://api.github.com/users/cxhong/following{/other_user}","gists_url":"https://api.github.com/users/cxhong/gists{/gist_id}","starred_url":"https://api.github.com/users/cxhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxhong/subscriptions","organizations_url":"https://api.github.com/users/cxhong/orgs","repos_url":"https://api.github.com/users/cxhong/repos","events_url":"https://api.github.com/users/cxhong/events{/privacy}","received_events_url":"https://api.github.com/users/cxhong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cxhong/xcat-core","description":"Code repo for xCAT core packages","fork":true,"url":"https://api.github.com/repos/cxhong/xcat-core","forks_url":"https://api.github.com/repos/cxhong/xcat-core/forks","keys_url":"https://api.github.com/repos/cxhong/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cxhong/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cxhong/xcat-core/teams","hooks_url":"https://api.github.com/repos/cxhong/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/cxhong/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/cxhong/xcat-core/events","assignees_url":"https://api.github.com/repos/cxhong/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/cxhong/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/cxhong/xcat-core/tags","blobs_url":"https://api.github.com/repos/cxhong/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cxhong/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cxhong/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/cxhong/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cxhong/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/cxhong/xcat-core/languages","stargazers_url":"https://api.github.com/repos/cxhong/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/cxhong/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/cxhong/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/cxhong/xcat-core/subscription","commits_url":"https://api.github.com/repos/cxhong/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/cxhong/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/cxhong/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/cxhong/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/cxhong/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/cxhong/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cxhong/xcat-core/merges","archive_url":"https://api.github.com/repos/cxhong/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cxhong/xcat-core/downloads","issues_url":"https://api.github.com/repos/cxhong/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/cxhong/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/cxhong/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/cxhong/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cxhong/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/cxhong/xcat-core/releases{/id}","deployments_url":"https://api.github.com/repos/cxhong/xcat-core/deployments","created_at":"2015-08-20T14:36:07Z","updated_at":"2016-01-15T23:03:44Z","pushed_at":"2016-05-17T20:14:38Z","git_url":"git://github.com/cxhong/xcat-core.git","ssh_url":"git@github.com:cxhong/xcat-core.git","clone_url":"https://github.com/cxhong/xcat-core.git","svn_url":"https://github.com/cxhong/xcat-core","homepage":null,"size":184618,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xcat2:master","ref":"master","sha":"1c35b8f26b7f54b4c4e641263f41d43918b10d25","user":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"repo":{"id":27747508,"name":"xcat-core","full_name":"xcat2/xcat-core","owner":{"login":"xcat2","id":10124414,"avatar_url":"https://avatars.githubusercontent.com/u/10124414?v=3","gravatar_id":"","url":"https://api.github.com/users/xcat2","html_url":"https://github.com/xcat2","followers_url":"https://api.github.com/users/xcat2/followers","following_url":"https://api.github.com/users/xcat2/following{/other_user}","gists_url":"https://api.github.com/users/xcat2/gists{/gist_id}","starred_url":"https://api.github.com/users/xcat2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcat2/subscriptions","organizations_url":"https://api.github.com/users/xcat2/orgs","repos_url":"https://api.github.com/users/xcat2/repos","events_url":"https://api.github.com/users/xcat2/events{/privacy}","received_events_url":"https://api.github.com/users/xcat2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xcat2/xcat-core","description":"Code repo for xCAT core packages","fork":false,"url":"https://api.github.com/repos/xcat2/xcat-core","forks_url":"https://api.github.com/repos/xcat2/xcat-core/forks","keys_url":"https://api.github.com/repos/xcat2/xcat-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xcat2/xcat-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xcat2/xcat-core/teams","hooks_url":"https://api.github.com/repos/xcat2/xcat-core/hooks","issue_events_url":"https://api.github.com/repos/xcat2/xcat-core/issues/events{/number}","events_url":"https://api.github.com/repos/xcat2/xcat-core/events","assignees_url":"https://api.github.com/repos/xcat2/xcat-core/assignees{/user}","branches_url":"https://api.github.com/repos/xcat2/xcat-core/branches{/branch}","tags_url":"https://api.github.com/repos/xcat2/xcat-core/tags","blobs_url":"https://api.github.com/repos/xcat2/xcat-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xcat2/xcat-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xcat2/xcat-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/xcat2/xcat-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xcat2/xcat-core/statuses/{sha}","languages_url":"https://api.github.com/repos/xcat2/xcat-core/languages","stargazers_url":"https://api.github.com/repos/xcat2/xcat-core/stargazers","contributors_url":"https://api.github.com/repos/xcat2/xcat-core/contributors","subscribers_url":"https://api.github.com/repos/xcat2/xcat-core/subscribers","subscription_url":"https://api.github.com/repos/xcat2/xcat-core/subscription","commits_url":"https://api.github.com/repos/xcat2/xcat-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/xcat2/xcat-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/xcat2/xcat-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/xcat2/xcat-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/xcat2/xcat-core/contents/{+path}","compare_url":"https://api.github.com/repos/xcat2/xcat-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xcat2/xcat-core/merges","archive_url":"https://api.github.com/repos/xcat2/xcat-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xcat2/xcat-core/downloads","issues_url":"https://api.github.com/repos/xcat2/xcat-core/issues{/number}","pulls_url":"https://api.github.com/repos/xcat2/xcat-core/pulls{/number}","milestones_url":"https://api.github.com/repos/xcat2/xcat-core/milestones{/number}","notifications_url":"https://api.github.com/repos/xcat2/xcat-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xcat2/xcat-core/labels{/name}","releases_url":"https://api.github.com/repos/xcat2/xcat-core/releases{/id}","deployments_url":"https://api.github.com/repos/xcat2/xcat-core/deployments","created_at":"2014-12-09T03:21:50Z","updated_at":"2016-05-17T23:23:54Z","pushed_at":"2016-05-18T02:19:51Z","git_url":"git://github.com/xcat2/xcat-core.git","ssh_url":"git@github.com:xcat2/xcat-core.git","clone_url":"https://github.com/xcat2/xcat-core.git","svn_url":"https://github.com/xcat2/xcat-core","homepage":null,"size":185017,"stargazers_count":37,"watchers_count":37,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"open_issues_count":132,"forks":49,"open_issues":132,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134"},"html":{"href":"https://github.com/xcat2/xcat-core/pull/1134"},"issue":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/1134"},"comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/issues/1134/comments"},"review_comments":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134/comments"},"review_comment":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xcat2/xcat-core/pulls/1134/commits"},"statuses":{"href":"https://api.github.com/repos/xcat2/xcat-core/statuses/abbd1817acf7ddcfee188f944b0eff5e09ca6b24"}}}}