os detcetion on RHEL 6
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OCS Inventory: Server |
New
|
Low
|
mortheres |
Bug Description
http://
Content of the patch:
--- ipdiscover-
+++ ipdiscover-util.pl 2013-04-17 10:35:54.546572082 -0700
@@ -557,14 +557,15 @@
open NMAP, "+>$path/
unless(
if($xml){
- print "<ERROR>
+ print "<ERROR>
exit(0);
}else{
die "An other analyse is in progress\n";
}
}
#Analyse
- system("nmap -R -v @ips -p 135,80,22,23 -oG $path/$filter.gnmap -P0 > /dev/null");
+ #system("nmap -R -v @ips -p 135,80,22,23 -oG $path/$filter.gnmap -P0 -O > /dev/null");
+ system("nmap -R -v @ips -p 135,80,22,23 -oG $path/$filter.gnmap -O > /dev/null");
#
my @gnmap;
if($net){
@@ -580,7 +581,30 @@
for $ref (@hosts){
$h = $$ref[1];
+ next if /^#/; # Skip comments
if(/Host: $h\b/){
+print "DEBUG: $h: $_\n";
+ if (/Status: Down/){
+ $PH[$j] = $ref;
+ $j++;
+ next REF;
+ }elsif(/Status: /){ # status up is meaningless to us
+ next;
+ }
+ # Try OS detection first
+ if(/OS: .*Windows/){
+ $PCW[$w] = $ref;
+ $w++;
+ next REF;
+ }elsif(/OS: .*Linux/ and !/OS: .*embedded/){
+ $PCL[$l] = $ref;
+ $l++;
+ next REF;
+ }elsif(/OS: /){ # Something else, call it network
+ $PR[$r] = $ref;
+ $r++;
+ next REF;
+ }
$w++;
@@ -590,10 +614,11 @@
$r++;
next REF;
- $PH[$j] = $ref;
+ $PR[$j] = $ref;
$j++;
- }elsif( (/\d\d\/f/) and ( (/\d\d\/o/) or (/\d\d\/c/) ) ){
+ #}elsif( (/\d\d\/f/) and ( (/\d\d\/o/) or (/\d\d\/c/) ) ){
+ }elsif(
$PF[$f] = $ref;
$f++;
next REF;
Changed in ocsinventory-server: | |
importance: | Undecided → Low |
assignee: | nobody → mortheres (mortheres) |
information type: | Private → Public |
Hi Frank,
This is bug is also related in Bug #1214436 . I mark it as duplicate of Bug #1214436