Bug 804701

Summary: Native (sigar) Platform plugin states "Win32" even on 64 bit systems
Product: [JBoss] JBoss Operations Network Reporter: Tom Fonteyne <tfonteyn>
Component: Plugin -- OtherAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: low    
Version: JON 3.0.0CC: hrupp, myarboro, skondkar
Target Milestone: ER01   
Target Release: JON 3.2.0   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 804705 (view as bug list) Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 804705    

Description Tom Fonteyne 2012-03-19 15:52:02 UTC
Description of problem:

64 bit Windows systems will be reported as being "Win32"

This is because 
   org/​ rhq/​ core/​ system/​ NativeSystemInfo.java 
report the string "as-is" from the native Sigar library

Version-Release number of selected component (if applicable):


How reproducible: always


Steps to Reproduce:
1. Start an agent in 64 bit JDK on a 64 bit Windows and let it discover the platform.
2. Import it in the JON server, and look at the details of the OS.
3.
  
Actual results:

Win32

Expected results:

Windows Server 2008 R2   (or similar for other Windows versions of course)

Additional info:

This is easy to fix by always reading the OS version from Java and NOT from Sigar.

org/​ rhq/​ core/​ system/​ NativeSystemInfo.java:

106     public String getOperatingSystemName() {
107         return OperatingSystem.getInstance().getName();
108     }

should be changed to (line numbers from JavaSystemInfo.java):

098     public String getOperatingSystemName() {
099         return System.getProperty("os.name");
100     }

It is debatable, but advisable to do the same for other calls in this class where Java is delivering a "good" result. Examples would be:
 getOperatingSystemVersion()
 getNumberOfCpus()

and likely more.

Comment 1 Tom Fonteyne 2012-03-19 15:57:10 UTC
cloned to RHQ as: https://bugzilla.redhat.com/show_bug.cgi?id=804705

Comment 2 Mike Foley 2012-03-26 15:57:48 UTC
medium, no target release 

per bz triage (crouch, mfoley, asantos, loleary)

Comment 3 Heiko W. Rupp 2013-08-12 12:01:19 UTC
According to https://bugzilla.redhat.com/show_bug.cgi?id=804705#c8 this is now in master and will be in er1

Comment 4 Sunil Kondkar 2013-11-19 12:14:00 UTC
Verified on version : 3.2.0.ER5 build Number :2cb2bc9:225c796
The OS name now shows "Windows" and Architecture value "x64" in details view and on monitoring->traits tab.