VMware Cloud Community
franciscoperedo
Contributor
Contributor

SIGAR: Fails to read registry and to filter processes in Windows 2000

My efforts to try to understand why Hyperic 4.1.2 fails to work properly in windows 2000 ( http://communities.vmware.com/thread/354965?tstart=0 ) have lead me to believe that the problem is at the SIGAR level.

According to

http://support.hyperic.com/display/SIGAR/Home

SIGAR supports: NT 4.0, 2000 Pro/Server, 2003 Server, XP, Vista, 2008 Server, 7

I decided to test that assumption in my Windows 2000:

C:\>cd "C:\Program Files\Hyperic HQ 4.1.2\agent-4.1.2\bundles\agent-4.1.2-1053\p
dk\lib"

C:\Program Files\Hyperic HQ 4.1.2\agent-4.1.2\bundles\agent-4.1.2-1053\pdk\lib>j
ava -jar sigar.jar

sigar> test

.test.TestRegistryKey.testRegistryRead.........ERROR
.test.TestRegistryKey.testHardwareValues.......ERROR
.test.TestRegistryKey.testSoftwareValues.......ERROR
.test.TestFileVersion.testCreate...............FAILED

Guess that solves the mistery, SIGAR fails on Windows 2000 when reading the registry (a feature needed for Tomcat autodiscovery).

My theory is that it also fails once Tomcat is running when it tries to verify if the process is running:

2009-10-21 08:57:21,671 DEBUG [Thread-1] [org.hyperic.hq.product.jmx.MxServerDetector] State.Name.sw=java,Args.*.sw=-Dcatalina.base= matched 0 processes

The failing code would the method inherited by MxServerDetector from ServerDetector:

protected static long[] getPids(String query) {
try {
return ProcessFinder.find(getSigar(), query);
} catch (SigarException e) {
return NO_PIDS;
}
}

And the root cause? the ProcessFinder.find finds nothing under Windows 2000... the strange thing is that the "ps" command work on SIGAR command line, so this ProcessFinder must be doing something differently.
Reply
0 Kudos
28 Replies
franciscoperedo
Contributor
Contributor

Will you create a JIRA entry for this?
Reply
0 Kudos
franciscoperedo
Contributor
Contributor

I see you already did it:

http://jira.hyperic.com/browse/SIGAR-185

Great! Many thanks!!!! 🙂
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

You can grab the updated sigar-x86-winnt.dll here: http://hudson.hyperic.com/job/sigar-1.6-x86-winnt/

Let us know how that goes and thanks again for figuring out where the problem was!

btw, we build the sigar-x86-winnt.dll above using the ancient visual studio 6 to make sure we don't link against windows API dependencies that might prevent sigar from running on NT or 2000. But clearly this didn't prevent this issue from slipping through. I'm going to hookup a win2k system to our hudson CI to run the sigar unit tests.
franciscoperedo
Contributor
Contributor

Downloading...
Reply
0 Kudos
franciscoperedo
Contributor
Contributor

Running in Windows 2000:

.test.TestRegistryKey.testRegistryWrite........ok

🙂 Great! 🙂 Great! 🙂 Great!

But, BTW it is still fails with:

.test.TestFileVersion.testCreate...............FAILED

That is of course, not related with this thread, but I thought you should know there is a problem with that.
Reply
0 Kudos
franciscoperedo
Contributor
Contributor

Duplicated message.

Message was edited by: franciscoperedo
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

Great news, hoping to see that Tomcat auto-discovery works now in the HQ thread!
As for the FileVersion test, can you run like so and paste the full stacktrace?
java -jar sigar-bin\lib\sigar.jar test FileVersion
Reply
0 Kudos
franciscoperedo
Contributor
Contributor

Yes, Tomcat auto-discovery now works!

Here is the stacktrace on the FileVersion test running on Windows 2000:

1) org.hyperic.sigar.win32.test.TestFileVersion:
junit.framework.AssertionFailedError
at org.hyperic.sigar.win32.test.TestFileVersion.testCreate(TestFileVersi
on.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.hyperic.sigar.test.SigarTestPrinter.runTests(SigarTestPrinter.jav
a:183)
at org.hyperic.sigar.test.SigarTestRunner.output(SigarTestRunner.java:13
9)
at org.hyperic.sigar.cmd.SigarCommandBase.processCommand(SigarCommandBas
e.java:188)
at org.hyperic.sigar.shell.ShellBase.processCommand(ShellBase.java:397)
at org.hyperic.sigar.cmd.Shell.processCommand(Shell.java:122)
at org.hyperic.sigar.shell.ShellBase.handleCommand(ShellBase.java:364)
at org.hyperic.sigar.cmd.Shell.main(Shell.java:225)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at org.hyperic.sigar.cmd.Runner.main(Runner.java:214)
Reply
0 Kudos
aurelie_hyperic
Contributor
Contributor

Hi,

Thanks Francisco for describing your compilation process. I came up with the same errors as you (except the last one because I had a copy of visual studio 2008 pro edition ) and you help me a lot to understand these.

🙂
Reply
0 Kudos