This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes

Bug 804705

Summary: Native (sigar) Platform plugin states "Win32" even on 64 bit systems
Product: [Other] RHQ Project Reporter: Tom Fonteyne <tfonteyn>
Component: PluginsAssignee: Charles Crouch <ccrouch>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: medium    
Version: 4.3CC: ccrouch, hbrock, hrupp, loleary
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Windows   
See Also:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 804701 Environment:
Last Closed: 2013-09-04 03:48:29 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 804701    
Bug Blocks:    

Description Tom Fonteyne 2012-03-19 11:55:43 EDT
+++ This bug was initially created as a clone of Bug #804701 +++

Description of problem:

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

This is because 
   org/​ rhq/​ core/​ system/​ 
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.
Actual results:


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/​

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

should be changed to (line numbers from

098     public String getOperatingSystemName() {
099         return System.getProperty("");
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:

and likely more.
Comment 1 Mike Foley 2012-03-26 11:57:37 EDT
medium, no target release 

per bz triage (crouch, mfoley, asantos, loleary)
Comment 2 Charles Crouch 2012-03-26 12:02:36 EDT
This should be raised as a Sigar JIRA
Comment 3 Tom Fonteyne 2012-03-26 12:09:13 EDT
fixing it in RHQ by simply avoiding to use the Sigar getOperatingSystemName is likely going to be much faster methinks
Comment 4 Charles Crouch 2012-03-26 18:39:21 EDT
Its almost always a good idea to see if fixes can be applied upstream.

Can you quickly create a JIRA at 

Title: OperatingSystem getName() returns "Win32" on a 64 bit Windows machine
Priority: High
Sigar version 1.6.5
-Run the java bindings for sigar on a 64 bit JDK on a 64 bit Windows machine.
-Check that OperatingSystem.getInstance().getName() returns Win32.
Comment 5 Ian Springer 2012-03-26 23:48:18 EDT
We already have a workaround for the SIGAR issue in the WindowsPlatformComponent class in the platform plugin (see bug #653496):

    protected MeasurementDataTrait getMeasurementDataTrait(MeasurementScheduleRequest request) {
        MeasurementDataTrait trait = super.getMeasurementDataTrait(request);
        // SIGAR returns "Win32" as the OS name for all Windows systems, even 64-bit ones, so add some special code
        // to instead return "Win64" for 64-bit systems.
        if (trait.getName().equals(TRAIT_OSNAME) && trait.getValue().equals(OS_NAME_WIN32)) {
            if ("x64".equals(getSysinfo().getSystemArchitecture())) {
        return trait;

Tom, is there another place you're seeing the bogus "Win32" value seep through?

Charles, I'll file a SIGAR bug tomorrow.
Comment 6 Tom Fonteyne 2012-03-27 03:56:30 EDT
@Ian:  indeed, I found that workaround as well, due to me searching for "Win32"

The other place is as reported in this bug in

org/​ rhq/​ core/​ system/​
Comment 7 Ian Springer 2012-03-27 16:30:43 EDT
I filed a SIGAR bug:
Comment 8 Ian Springer 2012-03-27 17:10:55 EDT
NativeSystemInfo.getOperatingSystemName() now returns "Windows", rather than "Win32", for Windows systems, since "Win32" does not seem like an appropriate value in the case of 64-bit Windows systems:

Comment 10 Heiko W. Rupp 2013-09-04 03:48:29 EDT
Bulk closing of some old issues