Bug 568760 - jmx plugin should not log warning if SIGAR is not available
Summary: jmx plugin should not log warning if SIGAR is not available
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 1.3
Hardware: All
OS: All
low
medium
Target Milestone: ---
: ---
Assignee: Ian Springer
QA Contact: Sunil Kondkar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-26 14:58 UTC by Ian Springer
Modified: 2013-08-06 00:36 UTC (History)
2 users (show)

Fixed In Version: 2.4
Clone Of:
Environment:
Last Closed: 2010-08-12 16:45:30 UTC
Embargoed:


Attachments (Terms of Use)

Description Ian Springer 2010-02-26 14:58:34 UTC
There is no need for it to log the warning, since the PC already logs a warning if SIGAR is not found. The warning is particularly undesirable when the JMX plugin is running inside the admin-console (EmbJopr), since SIGAR is intentionally not included with the admin-console (see https://jira.jboss.org/jira/browse/JBPAPP-3280).

Comment 1 Ian Springer 2010-02-26 20:18:22 UTC
Fixed as follows:

1) Stop logging the warning in the JMXDiscoveryComponent.discoverResources().
2) Stop logging the warning in SystemInfoFactory's static init block, since this also would get logged when running in the admin console.
3) Start logging once during Agent startup (in AgentMain), but don't log the warning if the user explicitly disabled the native system via their Agent config or via the -t command-line option. The underlying Throwable is saved by SystemInfoFactory and printed by AgentMain only if DEBUG is enabled.

Fix committed to gwt branch (git rev ab1816d) and cherry-picked to master branch (git rev 44ca5dd).

Note, in this same commit, I also updated the JMX Server Resource type to store its autodiscovery process table query expression in its plugin descriptor rather than hard-coding it in its discovery class.

Comment 2 Corey Welton 2010-03-25 02:15:41 UTC
qa -> skondkar

Comment 3 Corey Welton 2010-03-29 17:32:28 UTC
Mass-move to ON_QA

Comment 4 Ian Springer 2010-04-01 14:42:45 UTC
TEST AS FOLLOWS
===============
Test Case A
-----------
1) Start the Agent w/ the -t option to disable the native system.
2) Verify that the Agent logs the following INFO level message once:
      
  "The native system has been disabled."


Test Case B
-----------
1) Remove all SIGAR shared libraries from AGENT_HOME/lib/ (back them up to some other dir).
2) Start the Agent.
3) Verify that the Agent logs the following WARN level message once:

"Native system info is enabled, but the system info API is not accessible on this platform " +
                 "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path). " +
                 "Enable DEBUG logging for more details."

   Verify that no stack trace is dumped.


Test Case C
-----------
1) Remove all SIGAR shared libraries from AGENT_HOME/lib/ (back them up to some other dir).
2) Turn on DEBUG logging by setting RHQ_AGENT_DEBUG=1 in rhq-agent-env.sh.
3) Start the Agent.
4) Verify that the Agent logs the following DEBUG level message once:

"Native system info is enabled, but the system info API is not accessible on this platform " +
                 "(sigar.jar not found in classpath or SIGAR shared library not found in shared library path)."

   Verify that the message is followed by an exception stack trace.


For all of the above cases, verify that no warning related to SIGAR or native libraries being missing are logged by JMXDiscoveryComponent or SystemInfoFactory. The only message should be logged once at Agent startup by AgentMain (the messages described in the test cases above).

Comment 5 Sunil Kondkar 2010-04-06 07:01:07 UTC
Verified on master build #153, the INFO and WARN level messages are displayed as expected.

But below WARN/DEBUG messages are displayed twice in agent.log on agent startup. These messages are expected only once in agent.log.

Test case B) : Remove all SIGAR shared libraries, restart agent and verify WARN messages:

agent.log:

2010-04-05 14:43:28,192 WARN  [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-sysinfo-unavailable}Native system info is enabled, but the system info API is not accessible on this platform (sigar.jar not found in classpath or SIGAR shared library not found in shared library path). Enable DEBUG logging for more details.

2010-04-05 14:43:28,210 INFO  [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.identify-version}Version=[RHQ 3.0.0-SNAPSHOT], Build Number=[d5c27af], Build Date=[Apr 2, 2010 10:57 PM]

2010-04-05 14:43:28,210 WARN  [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-sysinfo-unavailable}Native system info is enabled, but the system info API is not accessible on this platform (sigar.jar not found in classpath or SIGAR shared library not found in shared library path). Enable DEBUG logging for more details.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Test case C) Remove all SIGAR shared libraries, turn on DEBUG logging by setting RHQ_AGENT_DEBUG=1, restart agent and verify messages.

agent.log

2010-04-05 14:56:22,551 DEBUG [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-sysinfo-unavailable-debug}Native system info is enabled, but the system info API is not accessible on this platform (sigar.jar not found in classpath or SIGAR shared library not found in shared library path).
2010-04-05 14:56:22,564 INFO  [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.identify-version}Version=[RHQ 3.0.0-SNAPSHOT], Build Number=[d5c27af], Build Date=[Apr 2, 2010 10:57 PM]
2010-04-05 14:56:22,564 DEBUG [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-sysinfo-unavailable-debug}Native system info is enabled, but the system info API is not accessible on this platform (sigar.jar not found in classpath or SIGAR shared library not found in shared library path).

Comment 6 Ian Springer 2010-04-09 20:20:59 UTC
As of commit 3f73687b9ddc7a102ec96e4bd9a1463bdcca825d to RHQ git, master branch, the warning should only be logged once at Agent startup.

Comment 7 Sunil Kondkar 2010-04-13 12:28:39 UTC
Verified on master build #196 (Revision:7f5c8df6eb4e8a7f24e43a1b7b7e414557feebb6)

 The INFO, WARN and DEBUG level messages are displayed as expected and only once at agent startup as below.


2010-04-13 17:25:43,482 INFO  [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-system-disabled}The native system has been disabled.


2010-04-13 17:29:53,241 WARN  [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-sysinfo-unavailable}Native system info is enabled, but the system info API is not accessible on this platform (sigar.jar not found in classpath or SIGAR shared library not found in shared library path). Enable DEBUG logging for more details.


2010-04-13 17:32:34,726 DEBUG [main] (org.rhq.enterprise.agent.AgentMain)- {AgentMain.native-sysinfo-unavailable-debug}Native system info is enabled, but the system info API is not accessible on this platform (sigar.jar not found in classpath or SIGAR shared library not found in shared library path).

Comment 8 Corey Welton 2010-08-12 16:45:30 UTC
Mass-closure of verified bugs against JON.


Note You need to log in before you can comment on or make changes to this bug.