You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(927) |
Apr
(419) |
May
(352) |
Jun
(431) |
Jul
(463) |
Aug
(345) |
Sep
(304) |
Oct
(596) |
Nov
(466) |
Dec
(414) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(348) |
Feb
(313) |
Mar
(665) |
Apr
(688) |
May
(434) |
Jun
(311) |
Jul
(540) |
Aug
(554) |
Sep
(467) |
Oct
(341) |
Nov
(365) |
Dec
(272) |
2009 |
Jan
(386) |
Feb
(293) |
Mar
(279) |
Apr
(239) |
May
(229) |
Jun
(199) |
Jul
(186) |
Aug
(111) |
Sep
(196) |
Oct
(146) |
Nov
(116) |
Dec
(140) |
2010 |
Jan
(170) |
Feb
(159) |
Mar
(151) |
Apr
(161) |
May
(90) |
Jun
(56) |
Jul
(28) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(23) |
Dec
(12) |
2011 |
Jan
(8) |
Feb
(8) |
Mar
(22) |
Apr
(24) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: rahma <sig...@hy...> - 2010-04-21 18:59:16
|
okay, excellent. thanks a lot "dougm". |
From: <bo...@hy...> - 2010-04-21 18:30:12
|
Author: bob Date: 2010-04-21 11:30:04 -0700 (Wed, 21 Apr 2010) New Revision: 14524 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14524 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties Log: Release 4.2.0.7 build #1285 Modified: branches/HQ_4_2_0_PATCH/etc/version.properties =================================================================== --- branches/HQ_4_2_0_PATCH/etc/version.properties 2010-04-21 07:56:01 UTC (rev 14523) +++ branches/HQ_4_2_0_PATCH/etc/version.properties 2010-04-21 18:30:04 UTC (rev 14524) @@ -1,3 +1,3 @@ -#Wed Mar 24 20:44:14 PDT 2010 +#Wed Apr 21 10:53:20 PDT 2010 version=4.2.0.7 -build=1284 +build=1285 |
From: <no...@gi...> - 2010-04-21 17:03:13
|
Branch: refs/heads/evolution Home: http://github.com/hyperic/hqapi Commit: c721662ac708a08379819e11a8130097a73cc6cd http://github.com/hyperic/hqapi/commit/c721662ac708a08379819e11a8130097a73cc6cd Author: Jennifer Hickey <jen...@sp...> Date: 2010-04-21 (Wed, 21 Apr 2010) Changed paths: M .gitignore Log Message: ----------- Added Eclipse metadata to gitignore |
From: <bo...@hy...> - 2010-04-21 07:56:10
|
Author: bob Date: 2010-04-21 00:56:01 -0700 (Wed, 21 Apr 2010) New Revision: 14523 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14523 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1415 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-04-21 05:10:04 UTC (rev 14522) +++ trunk/etc/version.properties 2010-04-21 07:56:01 UTC (rev 14523) @@ -1,3 +1,3 @@ -#Tue Apr 20 00:18:27 PDT 2010 +#Wed Apr 21 00:18:03 PDT 2010 version=4.3.0 -build=1414 +build=1415 |
From: <pn...@hy...> - 2010-04-21 05:10:13
|
Author: pnguyen Date: 2010-04-20 22:10:04 -0700 (Tue, 20 Apr 2010) New Revision: 14522 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14522 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/IndicatorChartsAction.java Log: [HHQ-3748] The "# Coll" column for availability is now = sum of # of metric data points for each resource in the group. The "SUM" column for percentage metrics now show the AVG value instead of calculating the # of resources in the group * AVG value. Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2010-04-21 00:35:42 UTC (rev 14521) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2010-04-21 05:10:04 UTC (rev 14522) @@ -276,14 +276,12 @@ summary.setMetric(MetricDisplayConstants.LAST_KEY, new MetricDisplayValue( data[MeasurementConstants.IND_LAST_TIME])); - } - else { - // Availability does not need to be summed - if (tmpl.isAvailability()) { + } else { + // Percentage metrics (including Availability) do not need to be summed + if (MeasurementConstants.UNITS_PERCENTAGE.equals(tmpl.getUnits())) { summary.setMetric(MetricDisplayConstants.LAST_KEY, new MetricDisplayValue(data[MeasurementConstants.IND_AVG])); - } - else { + } else { summary.setMetric(MetricDisplayConstants.LAST_KEY, new MetricDisplayValue( data[MeasurementConstants.IND_AVG] * Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2010-04-21 00:35:42 UTC (rev 14521) +++ trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2010-04-21 05:10:04 UTC (rev 14522) @@ -535,7 +535,7 @@ // Expect data to be sorted by end time, so that the last value // returned is the final count and the last value - data[IND_CFG_COUNT] = (objs[4] == null) + data[IND_CFG_COUNT] += (objs[4] == null) ? 0 : ((java.lang.Number)objs[4]).doubleValue(); data[IND_LAST_TIME] = ((Double)objs[2]).doubleValue(); Modified: trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/IndicatorChartsAction.java =================================================================== --- trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/IndicatorChartsAction.java 2010-04-21 00:35:42 UTC (rev 14521) +++ trunk/src/org/hyperic/hq/ui/action/resource/common/monitor/visibility/IndicatorChartsAction.java 2010-04-21 05:10:04 UTC (rev 14522) @@ -284,6 +284,10 @@ return data; } + /** + * TODO: The logic here is similar to MetricSessionEJB.getMetricDisplaySummary(). + * Need to consolidate the code. + */ private MetricDisplaySummary getSummarizedMetricData(MeasurementTemplate template, double[] data, long begin, long end, int totalConfigured) { MetricDisplaySummary summary = new MetricDisplaySummary(); @@ -314,8 +318,8 @@ if (totalConfigured == 1 || template.getCollectionType() == MeasurementConstants.COLL_TYPE_STATIC) { summary.setMetric(MetricDisplayConstants.LAST_KEY, new MetricDisplayValue(data[MeasurementConstants.IND_LAST_TIME])); } else { - // Availability does not need to be summed - if (template.isAvailability()) { + // Percentage metrics (including Availability) do not need to be summed + if (MeasurementConstants.UNITS_PERCENTAGE.equals(template.getUnits())) { summary.setMetric(MetricDisplayConstants.LAST_KEY, new MetricDisplayValue(data[MeasurementConstants.IND_AVG])); } else { summary.setMetric(MetricDisplayConstants.LAST_KEY, new MetricDisplayValue(data[MeasurementConstants.IND_AVG] * data[MeasurementConstants.IND_CFG_COUNT])); |
From: <no...@gi...> - 2010-04-20 23:15:32
|
Branch: refs/heads/evolution Home: http://github.com/hyperic/hqapi Commit: f7b0a18ea80eda5980ec35bd9455c4675519a150 http://github.com/hyperic/hqapi/commit/f7b0a18ea80eda5980ec35bd9455c4675519a150 Author: Jennifer Hickey <jen...@sp...> Date: 2010-04-20 (Tue, 20 Apr 2010) Changed paths: A hqapi1-client/src/main/resources/conf/log4j.properties A hqapi1/src/main/java/org/hyperic/hq/hqapi1/Connection.java A hqapi1/src/main/java/org/hyperic/hq/hqapi1/FileResponseHandler.java A hqapi1/src/main/java/org/hyperic/hq/hqapi1/ResponseHandler.java A hqapi1/src/main/java/org/hyperic/hq/hqapi1/XmlResponseHandler.java A hqapi1/src/main/java/org/hyperic/hq/hqapi1/tools/AbstractCommand.java A hqapi1/src/main/java/org/hyperic/hq/hqapi1/tools/CommandsFactory.java A hqapi1/src/main/java/org/hyperic/hq/hqapi1/tools/OptionParserFactory.java A hqapi1/src/main/resources/META-INF/spring/hqapi-context.xml A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/AlertDefinitionGetByResource_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/AlertDefinitionGetByResources_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/AlertFireRecovery_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/HierarchicalAlertingOff_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/HierarchicalAlertingOn_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/HierarchicalAlertingTestBase.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPTestBase.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv1Trap_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv2cInform_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv2cTrap_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv3InformAuthNoPriv_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv3InformAuthPriv_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv3InformNoAuthNoPriv_test.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv3InformTestBase.java A hqapi1/src/test/java/org/hyperic/hq/hqapi1/test/SNMPv3TrapAuthPriv_test.java R resources/META-INF/spring/hqapi-context.xml R resources/log4j.properties R src/org/hyperic/hq/hqapi1/Connection.java R src/org/hyperic/hq/hqapi1/FileResponseHandler.java R src/org/hyperic/hq/hqapi1/ResponseHandler.java R src/org/hyperic/hq/hqapi1/XmlResponseHandler.java R src/org/hyperic/hq/hqapi1/test/AlertDefinitionGetByResource_test.java R src/org/hyperic/hq/hqapi1/test/AlertDefinitionGetByResources_test.java R src/org/hyperic/hq/hqapi1/test/AlertFireRecovery_test.java R src/org/hyperic/hq/hqapi1/test/HierarchicalAlertingOff_test.java R src/org/hyperic/hq/hqapi1/test/HierarchicalAlertingOn_test.java R src/org/hyperic/hq/hqapi1/test/HierarchicalAlertingTestBase.java R src/org/hyperic/hq/hqapi1/test/MetricReschedule_test.java R src/org/hyperic/hq/hqapi1/test/SNMPTestBase.java R src/org/hyperic/hq/hqapi1/test/SNMPv1Trap_test.java R src/org/hyperic/hq/hqapi1/test/SNMPv2cInform_test.java R src/org/hyperic/hq/hqapi1/test/SNMPv2cTrap_test.java R src/org/hyperic/hq/hqapi1/test/SNMPv3InformAuthNoPriv_test.java R src/org/hyperic/hq/hqapi1/test/SNMPv3InformAuthPriv_test.java R src/org/hyperic/hq/hqapi1/test/SNMPv3InformNoAuthNoPriv_test.java R src/org/hyperic/hq/hqapi1/test/SNMPv3InformTestBase.java R src/org/hyperic/hq/hqapi1/test/SNMPv3TrapAuthPriv_test.java R src/org/hyperic/hq/hqapi1/tools/AbstractCommand.java R src/org/hyperic/hq/hqapi1/tools/CommandsFactory.java R src/org/hyperic/hq/hqapi1/tools/OptionParserFactory.java Log Message: ----------- Moved new src and resource files to proper dir structure Commit: 638d54e5e15fa8e0cec6477bea00b93024e2380f http://github.com/hyperic/hqapi/commit/638d54e5e15fa8e0cec6477bea00b93024e2380f Author: Jennifer Hickey <jen...@sp...> Date: 2010-04-20 (Tue, 20 Apr 2010) Changed paths: R lib/org.springframework.aop-3.0.1.RELEASE.jar R lib/org.springframework.asm-3.0.1.RELEASE.jar R lib/org.springframework.beans-3.0.1.RELEASE.jar R lib/org.springframework.context-3.0.1.RELEASE.jar R lib/org.springframework.context.support-3.0.1.RELEASE.jar R lib/org.springframework.core-3.0.1.RELEASE.jar R lib/org.springframework.expression-3.0.1.RELEASE.jar Log Message: ----------- Removed third party dependencies added by merge Commit: a386b0286d2aba9669a1c5b52bd6f6fd64279b01 http://github.com/hyperic/hqapi/commit/a386b0286d2aba9669a1c5b52bd6f6fd64279b01 Author: Jennifer Hickey <jen...@sp...> Date: 2010-04-20 (Tue, 20 Apr 2010) Changed paths: A .gitignore Log Message: ----------- Added gitignore Commit: 707fab7f6fd7c4143712a08d0decb6d76faef462 http://github.com/hyperic/hqapi/commit/707fab7f6fd7c4143712a08d0decb6d76faef462 Author: Jennifer Hickey <jen...@sp...> Date: 2010-04-20 (Tue, 20 Apr 2010) Changed paths: M hqapi1/pom.xml M parent/pom.xml Log Message: ----------- Added new Spring dependencies. Changed compliance level from "5" to "1.5", as the former made m2Eclipse give imported projects a compliance level of 1.4. Added jaxb dependencies b/c generated src had compilation errors on jaxb annotations due to 1.5 compliance level. |
From: <no...@gi...> - 2010-04-20 21:44:05
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 988fcbee9931bd3fb4a816f36f9ea578a002848f http://github.com/hyperic/hqapi/commit/988fcbee9931bd3fb4a816f36f9ea578a002848f Author: pnguyen <pnguyen@192.168.1.97> Date: 2010-04-20 (Tue, 20 Apr 2010) Changed paths: M src/org/hyperic/hq/hqapi1/test/ControlTestBase.java M src/org/hyperic/hq/hqapi1/test/GroupControlHistory_test.java Log Message: ----------- Update control history tests so that it doesn't require a completed control history to do integration testing for HQ-2080. |
From: Doug M. <do...@hy...> - 2010-04-20 20:21:22
|
resource_limit would't help there. Have a look at the hypertable code again: http://github.com/nuggetwheat/hypertable/blob/master/src/cc/Common/SystemInfo.cc#L254 sigar_cpu_perc_calculate gives you sigar_cpu_perc_t.combined which is the total % cpu used for the given sample time. |
From: rahma <sig...@hy...> - 2010-04-20 20:10:40
|
yes, am using vista OS. the problem is that i need to collect percentage consommation information. concerning memory information, i used "sigar_mem_get(sigar, &mem)", and then "mem.used_percent", but i can't have cpu percentage use. i thing combining cpu_cur and cpu_max using "sigar_resource_limit_get" function so that [cpu_used_percent = (cpu_cur*100)/cpu_max] . unfortunatelly my idea don't work in windows plateform as you mention. so have you any other proposition to get cpu percentage use? thanks in advance. |
From: <bo...@hy...> - 2010-04-20 07:53:50
|
Author: bob Date: 2010-04-20 00:53:42 -0700 (Tue, 20 Apr 2010) New Revision: 14520 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14520 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1414 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-04-19 23:03:46 UTC (rev 14519) +++ trunk/etc/version.properties 2010-04-20 07:53:42 UTC (rev 14520) @@ -1,3 +1,3 @@ -#Mon Apr 19 00:18:39 PDT 2010 +#Tue Apr 20 00:18:27 PDT 2010 version=4.3.0 -build=1413 +build=1414 |
From: <sc...@hy...> - 2010-04-19 23:03:57
|
Author: scottmf Date: 2010-04-19 16:03:46 -0700 (Mon, 19 Apr 2010) New Revision: 14519 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14519 Modified: trunk/installer/data/hq-engine/jboss-log4j.xml Log: [HHQ-3920] add extra information in log4j to debug issues and turn off useless WARN message Modified: trunk/installer/data/hq-engine/jboss-log4j.xml =================================================================== --- trunk/installer/data/hq-engine/jboss-log4j.xml 2010-04-19 18:27:13 UTC (rev 14518) +++ trunk/installer/data/hq-engine/jboss-log4j.xml 2010-04-19 23:03:46 UTC (rev 14519) @@ -94,6 +94,35 @@ <priority value="OFF"/> </category> + <!-- Turn off useless error messages, HHQ-3920 --> + <category name="org.hibernate.cache.ReadWriteCache"> + <priority value="OFF"/> + </category> + + <!-- To debug availability issues change the following from INFO to DEBUG --> + <category name="org.hyperic.hq.measurement.server.mbean.AvailabilityCheckService"> + <priority value="INFO"/> + </category> + <category name="org.hyperic.hq.measurement.server.session.ReportProcessorEJBImpl"> + <priority value="INFO"/> + </category> + + <!-- To debug agent scheduling issues change the following from INFO to DEBUG --> + <category name="org.hyperic.hq.measurement.server.session.MeasurementProcessorEJBImpl"> + <priority value="INFO"/> + </category> + <category name="org.hyperic.hq.measurement.server.session.AgentScheduleSynchronizer"> + <priority value="INFO"/> + </category> + + <!-- To debug autoinventory issues change the following from INFO to DEBUG --> + <category name="org.hyperic.hq.autoinventory.server.session.AutoinventoryManagerEJBImpl"> + <priority value="INFO"/> + </category> + <category name="org.hyperic.hq.autoinventory.server.session.ServiceMerger"> + <priority value="INFO"/> + </category> + <!-- Subsystem categories. Uncomment individual subsystems to see debug messages. --> <!-- |
From: Doug M. <do...@hy...> - 2010-04-19 22:44:42
|
Sounds like you're on a Windows platform, correct? On unix platforms the majority of resource_limit fields come from the standard getrlimit() function. getrlimit() does not exist on Windows, nor do most of the said limits. If you have pointers to any windows APIs or tools that display such limits, please let us know. |
From: Doug M. <do...@hy...> - 2010-04-19 20:08:47
|
Hi, ReadBytes is a counter, so you'll need to compare the difference over time. For example: Sigar sigar = new Sigar(); long prevTime = 0; long prevBytes = 0; final long interval = 1 * 1000; while (true) { long time = System.currentTimeMillis(); long bytes = sigar.getDiskUsage("D:").getReadBytes(); if (prevTime != 0) { long rate = (bytes - prevBytes) / ((time - prevTime) / interval); System.out.println("disk read bytes per second=" + Sigar.formatSize(rate)); } prevTime = time; prevBytes = bytes; Thread.sleep(interval); } |
From: <gla...@hy...> - 2010-04-19 18:53:51
|
Author: glaullon Date: 2010-04-19 11:27:13 -0700 (Mon, 19 Apr 2010) New Revision: 14518 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14518 Added: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseProductPlugin.java Removed: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SysbaseProductPlugin.java Modified: trunk/plugins/sybase/ trunk/plugins/sybase/etc/hq-plugin.xml trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseMeasurementPlugin.java trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseServerDetector.java trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseSysmonCollector.java Log: [HHQ-3790] Upgrading hq-agent through UI does not maintain Sybase functionality; all Sybase resources become unavailable [HHQ-3791] UI does not validate Sybase connection settings within Configuration Properties Property changes on: trunk/plugins/sybase ___________________________________________________________________ Name: svn:ignore - manifest.mf build bin nbproject build.xml sybase-plugin.jar hq.properties test + manifest.mf ToDo.txt test build.xml sybase-plugin.jar nbproject bin hq.properties build Modified: trunk/plugins/sybase/etc/hq-plugin.xml =================================================================== --- trunk/plugins/sybase/etc/hq-plugin.xml 2010-04-19 07:53:07 UTC (rev 14517) +++ trunk/plugins/sybase/etc/hq-plugin.xml 2010-04-19 18:27:13 UTC (rev 14518) @@ -29,33 +29,22 @@ USA. --> -<plugin package="org.hyperic.hq.plugin.sybase" class="SysbaseProductPlugin"> - <classpath> +<plugin package="org.hyperic.hq.plugin.sybase" class="SybaseProductPlugin"> + <!--classpath> <include name="pdk/lib/jdbc/jconn3.jar"/> <include name="pdk/lib/jdbc/jconn4.jar"/> <include name="pdk/lib/jdbc/jTDS3.jar"/> <include name="pdk/lib/jdbc/jTDS4.jar"/> - </classpath> + </classpath--> <!-- we use a dummy jmx object name --> <filter name="domain" value="sybase"/> <!-- appended to each template by MeasurementInfoXML --> <property name="template-config" - value="jdbcUrl=%jdbcUrl%,jdbcUser=%jdbcUser%,jdbcPassword=%jdbcPassword%"/> + value="interval=%interval%,jdbcUrl=%jdbcUrl%,jdbcUser=%jdbcUser%,jdbcPassword=%jdbcPassword%"/> <filter name="template" - value="${domain}:Type=Server:${alias}"/> - <metrics name="ServerMetrics"> - <metric name="Availability" - category="AVAILABILITY" - indicator="true" - units="percentage" - collectionType="dynamic"/> - - </metrics> - - <filter name="template" value="${domain}:Type=Service,instance=%instance%:${alias}"/> <metrics name="Sybase 12.x Instance"> <metric name="Availability" @@ -157,9 +146,9 @@ collectionType="dynamic"/> </metrics> - <filter name="template"> - sbSysmon:interval=%interval%,jdbcUrl=%jdbcUrl%,jdbcUser=%jdbcUser%,jdbcPassword=%jdbcPassword%:${alias} - </filter> + <filter name="template" + value="${domain}:Type=Server:${alias}"/> + <metrics name="SybaseAvailability"> <metric name="Availability" category="AVAILABILITY" @@ -168,6 +157,9 @@ collectionType="dynamic"/> </metrics> + <filter name="template"> + sbSysmon:interval=%interval%,jdbcUrl=%jdbcUrl%,jdbcUser=%jdbcUser%,jdbcPassword=%jdbcPassword%:${alias} + </filter> <metrics name="sp_sysmon"> <metric name="Deadlocks" category="THROUGHPUT" @@ -217,7 +209,6 @@ <plugin type="autoinventory" class="SybaseServerDetector"/> <metrics include="SybaseAvailability"/> - <metrics include="ServerMetrics"/> <metrics include="sp_sysmon"/> <properties> @@ -241,9 +232,6 @@ <option name="interval" description="sp_sysmon interval" default="00:05:00"/> - <option name="timeout" - description="Timeout for sp_sysmon, must be greater than the interval" - default="3500"/> </config> <service name="sp_sysmonEngine"> Modified: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseMeasurementPlugin.java =================================================================== --- trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseMeasurementPlugin.java 2010-04-19 07:53:07 UTC (rev 14517) +++ trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseMeasurementPlugin.java 2010-04-19 18:27:13 UTC (rev 14518) @@ -35,8 +35,9 @@ import java.sql.ResultSetMetaData; import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.apache.commons.logging.Log; -import org.hyperic.hq.product.Collector; import org.hyperic.hq.product.JDBCMeasurementPlugin; import org.hyperic.hq.product.Metric; @@ -53,7 +54,7 @@ public class SybaseMeasurementPlugin extends JDBCMeasurementPlugin { - private final Log _log = getLog(); + private final Log log = getLog(); private static final String JDBC_DRIVER = "com.sybase.jdbc3.jdbc.SybDriver"; @@ -289,6 +290,14 @@ try { // do not close cached connection conn = getCachedConnection(url, user, pass); + } catch (SQLException e) { + removeCachedConnection(url, user, pass); + DBUtil.closeConnection("[getValue]", conn); + String msg = "Commection failed for '" + alias + "': " + e.getMessage(); + throw new MetricNotFoundException(msg, e); + } + + try { if (objectName.indexOf(TYPE_SP_MONITOR_CONFIG) != -1) { res = getSP_MonitorConfigValue(metric, alias, conn); } else if (objectName.indexOf(TYPE_STORAGE) != -1) { @@ -299,7 +308,7 @@ } catch (SQLException e) { removeCachedConnection(url, user, pass); DBUtil.closeConnection(null, conn); - String msg = "Query failed for " + alias + ": " + e.getMessage(); + String msg = "Query failed for '" + alias + "': " + e.getMessage(); if (metric.isAvail()) { res = new MetricValue(Metric.AVAIL_DOWN); } else { @@ -309,7 +318,9 @@ if (res == null) { throw new MetricNotFoundException("cannot find metric " + metric); } - _log.debug("[getValue] alias='"+alias+"' res='"+res+"'"); + if (log.isDebugEnabled()) { + log.debug("[getValue] alias='" + alias + "' res='" + res + "' metric="+metric); + } return res; } @@ -326,10 +337,10 @@ res=Metric.AVAIL_UP; } catch (SQLException e) { - _log.debug("Query failed for Availability "+e.getMessage(),e); + log.debug("Query failed for Availability "+e.getMessage(),e); } finally { - DBUtil.closeJDBCObjects(_log, null, stmt, rs); + DBUtil.closeJDBCObjects(log, null, stmt, rs); } return new MetricValue(res, System.currentTimeMillis()); } @@ -377,7 +388,7 @@ } finally { if(stmt!=null) stmt.execute("use master"); // XXX why? - DBUtil.closeJDBCObjects(_log, null, stmt, rs); + DBUtil.closeJDBCObjects(log, null, stmt, rs); } return res; } @@ -458,9 +469,9 @@ res = Metric.AVAIL_UP; } } catch (SQLException e) { - _log.debug("[getAvail] configOpt='" + configOpt + "' -> " + e.getMessage()); + log.debug("[getAvail] configOpt='" + configOpt + "' -> " + e.getMessage()); } finally { - DBUtil.closeJDBCObjects(_log, null, stmt, rs); + DBUtil.closeJDBCObjects(log, null, stmt, rs); } return res; } @@ -495,7 +506,7 @@ } } finally { - DBUtil.closeJDBCObjects(_log, null, stmt, rs); + DBUtil.closeJDBCObjects(log, null, stmt, rs); } throw new SQLException(); } @@ -526,7 +537,7 @@ } catch (SQLException e) { throw new MetricUnreachableException(e.getMessage(), e); } finally { - DBUtil.closeJDBCObjects(_log, null, stmt, rs); + DBUtil.closeJDBCObjects(log, null, stmt, rs); } } } Copied: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseProductPlugin.java (from rev 14282, trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SysbaseProductPlugin.java) =================================================================== --- trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseProductPlugin.java (rev 0) +++ trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseProductPlugin.java 2010-04-19 18:27:13 UTC (rev 14518) @@ -0,0 +1,98 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.hyperic.hq.plugin.sybase; + +import java.io.File; +import java.util.Arrays; +import java.util.Properties; +import org.apache.commons.logging.Log; +import org.hyperic.hq.product.PluginException; +import org.hyperic.hq.product.PluginManager; +import org.hyperic.hq.product.ProductPlugin; +import org.hyperic.hq.product.ProductPluginManager; +import org.hyperic.sigar.Sigar; +import org.hyperic.sigar.SigarException; +import org.hyperic.sigar.ptql.ProcessFinder; +import org.hyperic.util.file.FileUtil; + +/** + * + * @author laullon + */ +public class SybaseProductPlugin extends ProductPlugin { + + private static String[] jars = {"jConnect-6_0/classes/jconn3.jar", + "jConnect-7_0/classes/jconn4.jar"}; + private static String saRole; + private static boolean originalAIID = true; + private static String PROP_CLASSPATH = "sybase.classpath"; + private static String PROP_INSTALLPATH = "sybase.installpath"; + Log log = getLog(); + + protected static boolean isOriginalAIID() { + return originalAIID; + } + + protected static String getSaRole(){ + return saRole; + } + + public void init(PluginManager manager) throws PluginException { + super.init(manager); + Properties props = manager.getProperties(); + originalAIID = "true".equals(props.getProperty("sysbase.aiid.orginal", "true").toLowerCase()); + saRole = props.getProperty("sysbase.sa_role", "sa_role"); + } + + public String[] getClassPath(ProductPluginManager manager) { + String[] res=_getClassPath(manager); + log.debug("[getClassPath] res="+Arrays.asList(res)); + return res; + } + + private String[] _getClassPath(ProductPluginManager manager) { + Properties props = manager.getProperties(); + + if (props.getProperty(PROP_CLASSPATH) != null) { + return props.getProperty(PROP_CLASSPATH).split(","); + } + + if (props.getProperty(PROP_INSTALLPATH) != null) { + return findJDBCJar(props.getProperty(PROP_INSTALLPATH)); + } + + String[] res = null; + try { + Sigar sigar = new Sigar(); + long[] pids = ProcessFinder.find(sigar, SybaseServerDetector.PTQL_QUERY); + for (int n = 0; ((n < pids.length) && (res == null)); n++) { + String installPath = sigar.getProcArgs(pids[n])[0]; + installPath = FileUtil.getParentDir(installPath, 3); + res = findJDBCJar(installPath); + } + } catch (SigarException ex) { + ex.printStackTrace(); + } + if (res == null) { + res = new String[]{}; + } + return res; + } + + private String[] findJDBCJar(String installPath) { + log.debug("[getClassPath] testing " + PROP_INSTALLPATH + "='" + installPath + "'"); + String[] res = null; + File ip = new File(installPath); + if (ip.exists()) { + for (int i = 0; ((i < jars.length) && (res == null)); i++) { + File jar = new File(ip, jars[i]); + if (jar.exists() && jar.canRead()) { + res = new String[]{jar.getAbsolutePath()}; + } + } + } + return res; + } +} Modified: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseServerDetector.java =================================================================== --- trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseServerDetector.java 2010-04-19 07:53:07 UTC (rev 14517) +++ trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseServerDetector.java 2010-04-19 18:27:13 UTC (rev 14518) @@ -34,6 +34,7 @@ import java.util.Arrays; import java.util.List; import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hyperic.hq.product.AutoServerDetector; import org.hyperic.hq.product.PluginException; @@ -62,7 +63,7 @@ PROP_URL = SybaseMeasurementPlugin.PROP_URL, PROP_USER = SybaseMeasurementPlugin.PROP_USER, PROP_PASSWORD = SybaseMeasurementPlugin.PROP_PASSWORD; - private static String PTQL_QUERY; + public static String PTQL_QUERY; static { if (isWin32()) { PTQL_QUERY = @@ -90,7 +91,7 @@ VERSION_12_5 = "12.5.x", VERSION_12_0 = "12.x"; - private Log log=getLog(); + private Log log=LogFactory.getLog(SybaseServerDetector.class); public List getServerResources(ConfigResponse config) throws PluginException { log.debug("[getServerResources] config=" + config); @@ -139,11 +140,6 @@ String installdir = getParentDir(path, 3); - ConfigResponse productConfig = new ConfigResponse(); - productConfig.setValue(PROP_USER, "sa"); - productConfig.setValue(PROP_PASSWORD, ""); - productConfig.setValue("serverName", name); - String version = ""; @@ -163,20 +159,24 @@ if (!version.equals(getTypeInfo().getVersion())) { return servers; } + + ConfigResponse measurementConfig = new ConfigResponse(); + measurementConfig.setValue("serverName", name); + ServerResource server = createServerResource(installpath); // Set custom properties ConfigResponse cprop = new ConfigResponse(); cprop.setValue("version", version); server.setCustomProperties(cprop); - setProductConfig(server, productConfig); - server.setMeasurementConfig(); + setProductConfig(server, new ConfigResponse()); + setMeasurementConfig(server,measurementConfig); server.setName(getPlatformName() + " " + SERVER_NAME + " " + version + " " + name); servers.add(server); - log.debug("sysbase.aiid.orginal=" + SysbaseProductPlugin.isOriginalAIID()); + log.debug("sysbase.aiid.orginal=" + SybaseProductPlugin.isOriginalAIID()); log.debug("installdir=" + installdir); log.debug("installpath=" + installpath); - if (SysbaseProductPlugin.isOriginalAIID()) { + if (SybaseProductPlugin.isOriginalAIID()) { server.setIdentifier(installdir); } else { server.setIdentifier(installpath); Modified: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseSysmonCollector.java =================================================================== --- trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseSysmonCollector.java 2010-04-19 07:53:07 UTC (rev 14517) +++ trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SybaseSysmonCollector.java 2010-04-19 18:27:13 UTC (rev 14518) @@ -7,6 +7,7 @@ import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DriverManager; +import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLWarning; import java.util.Arrays; @@ -29,6 +30,7 @@ */ public class SybaseSysmonCollector extends Collector { + public static final String INTERVAL = "interval"; static Log trace = LogFactory.getLog("trace." + SybaseSysmonCollector.class); static Log log = LogFactory.getLog(SybaseSysmonCollector.class); private CallableStatement stmt; @@ -37,32 +39,49 @@ protected void init() throws PluginException { Properties props = getProperties(); - String url = props.getProperty(JDBCMeasurementPlugin.PROP_URL, ""), - user = props.getProperty(JDBCMeasurementPlugin.PROP_USER, ""), - pass = props.getProperty(JDBCMeasurementPlugin.PROP_PASSWORD, ""); - + Connection c = null; + ResultSet rs = null; + CallableStatement st = null; + String sa_role = SybaseProductPlugin.getSaRole(); + try { - conn = createConnection(url, user, pass); - } catch(SQLException e) { - throw new PluginException("Create connection failed:" + e.getMessage(), e); + c = createConnection(props); + st = c.prepareCall("{call sp_displayroles}"); + rs = st.executeQuery(); + boolean roleOK = false; + while (rs.next() && !roleOK) { + roleOK = rs.getString(1).equals(sa_role); + } + if (!roleOK) { + throw new PluginException("Could not connect using information provided: The user must have System Administrator ('" + sa_role + "') role"); + } + } catch (SQLException e) { + throw new PluginException("Could not connect using information provided", e); + } finally { + DBUtil.closeJDBCObjects(log, c, st, rs); } - + + String interval = props.getProperty(SybaseSysmonCollector.INTERVAL); + Pattern p = Pattern.compile("^\\d\\d:\\d\\d:\\d\\d$"); + Matcher m = p.matcher(interval); + if (!m.matches()) { + String msg = "Configuration failed: bad INTERVAL format ##:##:## (" + interval + ")"; + throw new PluginException(msg); + } + super.init(); } public void collect() { - Properties props = getProperties(); + log.debug("[collect] props=" + props); - String url = props.getProperty(JDBCMeasurementPlugin.PROP_URL, ""), - user = props.getProperty(JDBCMeasurementPlugin.PROP_USER, ""), - pass = props.getProperty(JDBCMeasurementPlugin.PROP_PASSWORD, ""); try { setAvailability(Metric.AVAIL_DOWN); if (conn == null) { - conn = createConnection(url, user, pass); + conn = createConnection(props); } - stmt = conn.prepareCall("{call sp_sysmon '" + props.getProperty("interval") + "'}"); + stmt = conn.prepareCall("{call sp_sysmon '" + props.getProperty(INTERVAL) + "'}"); stmt.executeUpdate(); StringBuffer response = new StringBuffer(); @@ -79,8 +98,10 @@ Matcher m = pat.matcher(res); while (m.find()) { final String cacheName = m.group(1).trim().replaceAll(" ", "_"); - trace.debug("->'" + cacheName + "'"); - trace.debug("->" + m.start()); + if (trace.isDebugEnabled()) { + trace.debug("->'" + cacheName + "'"); + trace.debug("->" + m.start()); + } String sec = res.substring(m.start()); setValue(cacheName + ".Availability", Metric.AVAIL_UP); setValue(cacheName + ".CacheHitsRatio", get(sec, "Cache Hits", 5) / 100); @@ -130,11 +151,13 @@ Matcher lm = pat.matcher(txt); if (lm.find()) { String line = lm.group(); - log.debug(line); line = line.trim().replaceAll(" +", " "); vals = line.split(" "); - log.debug(line); - log.debug(Arrays.asList(vals)); + if (trace.isDebugEnabled()) { + trace.debug(line); + trace.debug(line); + trace.debug(Arrays.asList(vals)); + } if (!vals[index].equals("n/a")) { res = Double.parseDouble(vals[index]); } else { @@ -143,15 +166,17 @@ } } catch (ArrayIndexOutOfBoundsException e) { res = Double.NaN; - log.debug("vals=> '" + Arrays.asList(vals) + "' pro='" + pro + "' index='" + index + "'"); + trace.debug("vals=> '" + Arrays.asList(vals) + "' pro='" + pro + "' index='" + index + "'"); } return res; } - protected Connection createConnection(String url, String user, String password) throws SQLException { - String pass = (password == null) ? "" : password; + protected Connection createConnection(Properties p) throws SQLException { + String url = p.getProperty(JDBCMeasurementPlugin.PROP_URL, ""); + String user = p.getProperty(JDBCMeasurementPlugin.PROP_USER, ""); + String pass = p.getProperty(JDBCMeasurementPlugin.PROP_PASSWORD, ""); pass = (pass.matches("^\\s*$")) ? "" : pass; - java.util.Properties props = new java.util.Properties(); + Properties props = new java.util.Properties(); props.put("CHARSET_CONVERTER_CLASS", "com.sybase.jdbc3.utils.TruncationConverter"); props.put("user", user); props.put("password", pass); Deleted: trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SysbaseProductPlugin.java =================================================================== --- trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SysbaseProductPlugin.java 2010-04-19 07:53:07 UTC (rev 14517) +++ trunk/plugins/sybase/src/org/hyperic/hq/plugin/sybase/SysbaseProductPlugin.java 2010-04-19 18:27:13 UTC (rev 14518) @@ -1,31 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package org.hyperic.hq.plugin.sybase; - -import java.util.Properties; -import org.apache.commons.logging.Log; -import org.hyperic.hq.product.PluginException; -import org.hyperic.hq.product.PluginManager; -import org.hyperic.hq.product.ProductPlugin; - -/** - * - * @author laullon - */ -public class SysbaseProductPlugin extends ProductPlugin { - - private static boolean originalAIID = true; - Log log = getLog(); - - protected static boolean isOriginalAIID() { - return originalAIID; - } - - public void init(PluginManager manager) throws PluginException { - super.init(manager); - Properties props = manager.getProperties(); - originalAIID = "true".equals(props.getProperty("sysbase.aiid.orginal", "true").toLowerCase()); - } -} |
From: <bo...@hy...> - 2010-04-19 07:53:16
|
Author: bob Date: 2010-04-19 00:53:07 -0700 (Mon, 19 Apr 2010) New Revision: 14517 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14517 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1413 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-04-18 07:56:33 UTC (rev 14516) +++ trunk/etc/version.properties 2010-04-19 07:53:07 UTC (rev 14517) @@ -1,3 +1,3 @@ -#Sun Apr 18 00:18:40 PDT 2010 +#Mon Apr 19 00:18:39 PDT 2010 version=4.3.0 -build=1412 +build=1413 |
From: <bo...@hy...> - 2010-04-18 07:56:48
|
Author: bob Date: 2010-04-18 00:56:33 -0700 (Sun, 18 Apr 2010) New Revision: 14516 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14516 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1412 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-04-17 07:56:39 UTC (rev 14515) +++ trunk/etc/version.properties 2010-04-18 07:56:33 UTC (rev 14516) @@ -1,3 +1,3 @@ -#Sat Apr 17 00:17:46 PDT 2010 +#Sun Apr 18 00:18:40 PDT 2010 version=4.3.0 -build=1411 +build=1412 |
From: rahma <sig...@hy...> - 2010-04-17 19:22:03
|
thanks dogum for your quick reply. i solve my actual problem. in fact i am using code::blocks as IDE and i didn't attach correctly the SIGAR lib to the compiler so i got the errors. now every thing look good. later i will put an exemple of a C++ project using SIGAR. |
From: Gerry E. <ger...@gm...> - 2010-04-17 19:22:03
|
Hello. I am trying to retrieve the number of disk read bytes at any one time with SIGAR and I'm having some unusual results. when I run this code: Sigar sigar = new Sigar(); org.hyperic.sigar.DiskUsage infos = sigar.getDiskUsage("D:\\"); long read = infos.getReadBytes(); I get a very big number that is not representative of the disk usage. Can anyone suggest what I'm doing wrong? I'd be very pleased! the numbers coming back are in the region of: 628467 629786 629514 |
From: rahma <sig...@hy...> - 2010-04-17 19:22:01
|
hello, i am using sigar in a C++ project. i want to mesure max available ressources. so i used sigar_resource_limit_get, Unfortunately I came across this problem: for different parameters (memory, cpu, ...) the current value is equal to max one wich is not correct. for example : cout << "current memory used : " << rlimit.memory_cur << endl; cout << "max memory : " << rlimit.memory_max << endl; it shows the same value. cout << "current processes : " << rlimit.processes_cur << endl; cout << "max processes : " << rlimit.processes_max << endl; shows the same value. and this is for all attributes in sigar_resource_limit_t struct. any comments or explications please???????? |
From: rahma <sig...@hy...> - 2010-04-17 19:22:00
|
hello i need to get some system information like memory and CPU use, i find the SIGAR API and i think it fits perfectly to my need. the problem is that i can't integrate it in my C++ project. any help is welcomed. Thanks in advance. |
From: <bo...@hy...> - 2010-04-17 11:20:30
|
Author: bob Date: 2010-04-17 00:56:39 -0700 (Sat, 17 Apr 2010) New Revision: 14515 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14515 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1411 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-04-16 20:21:43 UTC (rev 14514) +++ trunk/etc/version.properties 2010-04-17 07:56:39 UTC (rev 14515) @@ -1,3 +1,3 @@ -#Fri Apr 16 00:20:16 PDT 2010 +#Sat Apr 17 00:17:46 PDT 2010 version=4.3.0 -build=1410 +build=1411 |
From: <no...@gi...> - 2010-04-16 21:06:24
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 26c9faf648d9dc18d283976cc59015217be1f3e5 http://github.com/hyperic/hqapi/commit/26c9faf648d9dc18d283976cc59015217be1f3e5 Author: pnguyen <pnguyen@192.168.1.177> Date: 2010-04-16 (Fri, 16 Apr 2010) Changed paths: M ChangeLog M hqu/hqapi1/app/AlertController.groovy M hqu/hqapi1/app/AlertdefinitionController.groovy M src/org/hyperic/hq/hqapi1/AlertDefinitionBuilder.java A src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncSNMPAction_test.java M src/org/hyperic/hq/hqapi1/test/SNMPTestBase.java M src/org/hyperic/hq/hqapi1/test/SNMPv1Trap_test.java M src/org/hyperic/hq/hqapi1/test/SNMPv2cInform_test.java M src/org/hyperic/hq/hqapi1/test/SNMPv2cTrap_test.java M src/org/hyperic/hq/hqapi1/test/SNMPv3InformTestBase.java M src/org/hyperic/hq/hqapi1/test/SNMPv3TrapAuthPriv_test.java Log Message: ----------- Add support to sync alert definitions with SNMP actions. Functionality added primarily to do integration testing for HQ-2047. Commit: 644cf4ce16cd9175ac55a666432733b849cae912 http://github.com/hyperic/hqapi/commit/644cf4ce16cd9175ac55a666432733b849cae912 Author: Patrick Nguyen <pnguyen@patrick-nguyens-macbook-pro.local> Date: 2010-04-16 (Fri, 16 Apr 2010) Changed paths: M src/org/hyperic/hq/hqapi1/tools/Shell.java Log Message: ----------- Merge branch 'master' of git://github.com/hyperic/hqapi |
From: <jko...@hy...> - 2010-04-16 20:23:45
|
Author: jkonicki Date: 2010-04-16 13:21:43 -0700 (Fri, 16 Apr 2010) New Revision: 14514 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14514 Modified: trunk/src/org/hyperic/hq/product/ProductPluginManager.java trunk/src/org/hyperic/hq/product/ant/PluginJar.java Log: HHQ-3842 The manifests will now be printed when running the agent in debug mode, or the plugindumper is executed with debug logging. Modified: trunk/src/org/hyperic/hq/product/ProductPluginManager.java =================================================================== --- trunk/src/org/hyperic/hq/product/ProductPluginManager.java 2010-04-16 19:19:35 UTC (rev 14513) +++ trunk/src/org/hyperic/hq/product/ProductPluginManager.java 2010-04-16 20:21:43 UTC (rev 14514) @@ -30,6 +30,9 @@ import java.io.FileInputStream; import java.io.InputStream; import java.lang.reflect.Method; +import java.net.JarURLConnection; +import java.net.MalformedURLException; +import java.net.URL; import java.util.Arrays; import java.util.Comparator; @@ -40,6 +43,7 @@ import java.util.Iterator; import java.util.Properties; import java.util.Set; +import java.util.jar.Attributes; import org.hyperic.hq.agent.AgentConfig; import org.hyperic.hq.common.LicenseManager; @@ -881,6 +885,29 @@ addClassPath(loader, path); } } + + private void logPluginManifest(String jarName) { + if (log.isDebugEnabled()) { + URL url; + try { + url = new URL("jar", "", "file:" + jarName + "!/"); + JarURLConnection jarConn = (JarURLConnection) url.openConnection(); + Map attributeMap = jarConn.getManifest().getMainAttributes(); + if (!attributeMap.isEmpty()) { + StringBuilder manifestLog = new StringBuilder("\n--- Manifest entries for: " + url.toString() + + " ---\n"); + Iterator iter = attributeMap.entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry entry = (Map.Entry) iter.next(); + manifestLog.append(entry.getKey() + " - " + entry.getValue() + "\n"); + } + log.debug(manifestLog.toString()); + } + } catch (Exception e) { + log.debug("Manifest retrieval had an exception (continuing): " + e.getMessage()); + } + } + } /** * Load a product plugin jar. @@ -909,7 +936,8 @@ PluginLoader loader = PluginLoader.create(jarName, this.getClass().getClassLoader()); - + + logPluginManifest(jarName); PluginLoader.setClassLoader(loader); ClassLoader dataLoader; if (resourceLoader != null) { Modified: trunk/src/org/hyperic/hq/product/ant/PluginJar.java =================================================================== --- trunk/src/org/hyperic/hq/product/ant/PluginJar.java 2010-04-16 19:19:35 UTC (rev 14513) +++ trunk/src/org/hyperic/hq/product/ant/PluginJar.java 2010-04-16 20:21:43 UTC (rev 14514) @@ -207,30 +207,44 @@ try { addConfiguredManifest(manifest); manifest.getMainSection().addConfiguredAttribute(new Attribute("Build-Owner", getProperty("user.name", - "Unknown"))); + "Unknown"))); String hostName = "Unknown"; try { hostName = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { - //ignore + // ignore } manifest.getMainSection().addConfiguredAttribute(new Attribute("Build-Host", hostName)); - + if (getProperty("release.comment", null) != null) { manifest.getMainSection() .addConfiguredAttribute(new Attribute("Build-Type", getProperty("release.comment", "Unknown"))); } manifest.getMainSection().addConfiguredAttribute(new Attribute("Build-Date", new Date().toString())); - manifest.getMainSection().addConfiguredAttribute(new Attribute("Specification-Title", "HQU Plugin")); - manifest.getMainSection().addConfiguredAttribute(new Attribute("Specification-Vendor", "VMware Inc.")); - manifest.getMainSection().addConfiguredAttribute(new Attribute("Specification-Version", - getProperty("version", "Unknown") + "-" + - getProperty("build", "Unknown"))); + manifest.getMainSection().addConfiguredAttribute(new Attribute("Specification-Title", + getProperty("specification.title", + "HQ Plugin"))); + manifest.getMainSection().addConfiguredAttribute(new Attribute("Specification-Vendor", + getProperty("specification.vendor", + "VMware Inc."))); + manifest.getMainSection() + .addConfiguredAttribute(new Attribute("Specification-Version", + getProperty("specification.version", getProperty("version", + "Unknown") + + "-" + + getProperty("build", + "Unknown")))); manifest.getMainSection().addConfiguredAttribute(new Attribute("Implementation-Title", getName())); - manifest.getMainSection().addConfiguredAttribute(new Attribute("Implementation-Version", - getProperty("version", "Unknown") + "-" + - getProperty("build", "Unknown"))); - manifest.getMainSection().addConfiguredAttribute(new Attribute("Implementation-Vendor", "VMware Inc.")); + manifest.getMainSection().addConfiguredAttribute(new Attribute("Implementation-Vendor", + getProperty("implementation.vendor", + "VMware Inc."))); + manifest.getMainSection() + .addConfiguredAttribute(new Attribute("Implementation-Version", + getProperty("implementation.version", getProperty("version", + "Unknown") + + "-" + + getProperty("build", + "Unknown")))); String mainClass = getMainClass(); if (mainClass != null) { |
From: <gla...@hy...> - 2010-04-16 19:19:45
|
Author: glaullon Date: 2010-04-16 12:19:35 -0700 (Fri, 16 Apr 2010) New Revision: 14513 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14513 Modified: trunk/plugins/websphere/etc/hq-plugin.xml trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java Log: [HHQ-3864] WebSphere 7.0 Server not found on Windows [HHQ-3836] WebSphere Control Program path for Windows incorrectly defaults to startServer.sh [HHQ-3903] NPE: Unexpected error running autodiscoverer for plugin: WebSphere Admin 6.1: null Modified: trunk/plugins/websphere/etc/hq-plugin.xml =================================================================== --- trunk/plugins/websphere/etc/hq-plugin.xml 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/etc/hq-plugin.xml 2010-04-16 19:19:35 UTC (rev 14513) @@ -414,6 +414,20 @@ type="secret"/> </config> + <config name="control"> + <option name="program.start" + optional="true" + description="Start Script" + default="bin/startServer.sh"/> + + <option name="program.stop" + optional="true" + description="Stop Script" + default="bin/stopServer.sh"/> + </config> + + + <property name="websphere.regkey" value="SOFTWARE\IBM\WebSphere Application Server"/> @@ -446,6 +460,7 @@ </scan> <config include="connector"/> + <config include="control" type="control"/> </server> @@ -473,6 +488,7 @@ <config include="connector"/> + <config include="control" type="control"/> <properties> <property name="javaVendor" Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -61,16 +61,19 @@ setAvailability(true); return; } - Object state = - getAttribute(getMBeanServer(), this.name, "state"); + try{ + Object state = + getAttribute(getMBeanServer(), this.name, "state"); - log.debug("[collect] name='"+name.getKeyProperty("name")+"' state='"+state+"("+state.getClass()+")'"); - - if ((state == null) || (!(state instanceof Integer))) { + if ((state == null) || (!(state instanceof Integer))) { + setAvailability(false); + } + else { + setAvailability(((Integer)state).intValue()==1); + } + }catch(PluginException e){ setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(((Integer)state).intValue()==1); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -108,14 +108,19 @@ if (mServer == null) { return; } - JDBCStats stats = (JDBCStats)getStats(mServer, this.name); - if (stats == null) { - return; + try { + JDBCStats stats = (JDBCStats)getStats(mServer, this.name); + if (stats == null) { + return; + } + setAvailability(true); + Stats[] pools = stats.getConnectionPools(); + for (int i=0; i<pools.length; i++) { + collectStatCount(pools[i], ATTRS); + } + } catch (PluginException e) { + setAvailability(false); + setMessage(e.getMessage()); } - setAvailability(true); - Stats[] pools = stats.getConnectionPools(); - for (int i=0; i<pools.length; i++) { - collectStatCount(pools[i], ATTRS); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -52,14 +52,19 @@ } public void collect() { - Object ejbs = - getAttribute(getMBeanServer(), this.name, "ejbs"); + try { + Object ejbs = + getAttribute(getMBeanServer(), this.name, "ejbs"); - if (ejbs == null) { + if (ejbs == null) { + setAvailability(false); + } + else { + setAvailability(true); + } + } catch (PluginException e) { setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(true); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -56,17 +56,22 @@ if (mServer == null) { return; } - Stats stats = getStats(mServer, this.name); - if (stats == null) { - //XXX certain threadpools have no stats, why? - Object o = getAttribute(mServer, this.name, "name"); - if (o != null) { + try { + Stats stats = getStats(mServer, this.name); + if (stats == null) { + //XXX certain threadpools have no stats, why? + Object o = getAttribute(mServer, this.name, "name"); + if (o != null) { + setAvailability(true); + } + } + else { setAvailability(true); + collectStatCount(stats, ATTRS); } + } catch (PluginException e) { + setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(true); - collectStatCount(stats, ATTRS); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -52,14 +52,19 @@ } public void collect() { - Object servlets = - getAttribute(getMBeanServer(), this.name, "servlets"); + try{ + Object servlets = + getAttribute(getMBeanServer(), this.name, "servlets"); - if (servlets == null) { + if (servlets == null) { + setAvailability(false); + } + else { + setAvailability(true); + } + } catch (PluginException e) { setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(true); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -40,6 +40,10 @@ protected List discoverServers(ConfigResponse config) throws PluginException { + if (!WebsphereProductPlugin.VALID_JVM) { + return new ArrayList(); + } + if (this.discoverer == null) { String version = getTypeInfo().getVersion(); this.discoverer = new WebsphereRuntimeDiscoverer(version, this); @@ -65,18 +69,6 @@ return this.discoverer.discoverServers(config); } - protected static String getStartupScript() { - if (isWin32()) { - return "bin\\startNode.bat"; - } else { - return "bin/startNode.sh"; - } - } - - /*public String getIdentifier(WebSphereProcess proc) { - return proc.getServerRoot(); - }*/ - public List getServerResources(ConfigResponse platformConfig) throws PluginException { List servers = new ArrayList(); List processes = getServerProcessList(getProcessQuery()); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -83,6 +83,10 @@ } protected void init() throws PluginException { + if(log.isDebugEnabled()){ + log.debug("[init] ("+getClass().getName()+") props="+getProperties()); + } + AdminClient mServer = getMBeanServer(); if(mServer==null) return; @@ -142,7 +146,8 @@ protected Object getAttribute(AdminClient mServer, ObjectName name, - String attr) { + String attr) + throws PluginException{ try { WebsphereStopWatch timer = new WebsphereStopWatch(); @@ -163,11 +168,11 @@ log.debug("getAttribute(" + name + ", " + attr + "): " + e.getMessage(), e); } - return null; + throw new PluginException(e.getMessage()); } } - protected Stats getStats(AdminClient mServer, ObjectName name) { + protected Stats getStats(AdminClient mServer, ObjectName name) throws PluginException { return (Stats)getAttribute(mServer, name, "stats"); } @@ -222,7 +227,7 @@ return super.getValue(metric, result); } - protected boolean collectStats(ObjectName name) { + protected boolean collectStats(ObjectName name) throws PluginException { AdminClient mServer = getMBeanServer(); if (mServer == null) { return false; @@ -230,7 +235,7 @@ return collectStats(mServer, name); } - protected boolean collectStats(AdminClient mServer, ObjectName oname) { + protected boolean collectStats(AdminClient mServer, ObjectName oname) throws PluginException { Stats stats = getStats(mServer, oname); if (stats == null) { setAvailability(false); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -45,23 +45,8 @@ private static final List commands = Arrays.asList(actions); private InetPortPinger portPinger; - private String binDir = null; private String[] ctlArgs = new String[0]; - protected String getDefaultScript() { - return - "bin/startServer" + - getScriptExtension(getTypeInfo()); - } - - public void init(PluginManager manager) - throws PluginException { - - super.init(manager); - setTimeout(DEFAULT_TIMEOUT * 10); - setControlProgram(getDefaultScript()); - } - protected String getAdminHost() { return getConfig().getValue(WebsphereProductPlugin.PROP_ADMIN_HOST); } @@ -100,12 +85,6 @@ { super.configure(config); - validateControlProgram(WebsphereProductPlugin.SERVER_NAME); - - this.binDir = getControlProgramDir(); - - //5.0 startup script takes server.name as an arg - //and stop takes user/pass w/ global security enabled String username = getUsername(); String password = getPassword(); @@ -186,7 +165,8 @@ } protected int doCommand(String action, String[] args) { - String script = this.binDir + File.separator + action + "Server.sh"; + String script=getConfig().getValue(PROP_PROGRAM+"."+action); + setControlProgram(script); getLog().debug("command script=" + script); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -80,6 +80,8 @@ private String node = null; protected List discoverServices(ConfigResponse config) throws PluginException { + if(!WebsphereProductPlugin.VALID_JVM) return new ArrayList(); + if (this.discoverer == null) { String version = getTypeInfo().getVersion(); this.discoverer = new WebsphereRuntimeDiscoverer(version, this); @@ -144,15 +146,24 @@ return this.node; } - protected static String getStartupScript() { - if (isWin32()) { - return "bin\\startServer.bat"; - } - else { - return "bin/startServer.sh"; - } + public final String getControlScript(String script) { + return "bin"+File.separatorChar+script+getScriptExtension(); } + public final ConfigResponse getControlConfig(WebSphereProcess proc) { + String type = proc.getServer().equals("nodeagent") ? "Node" : "Server"; + File cs1 = new File(proc.getServerRoot(), getControlScript("start" + type)); + File cs2 = new File(proc.getServerRoot(), getControlScript("stop" + type)); + assert cs1.exists() : cs1.getAbsolutePath(); + assert cs2.exists() : cs2.getAbsolutePath(); + ConfigResponse cc = new ConfigResponse(); + cc.setValue(ServerControlPlugin.PROP_PROGRAM + ".start", cs1.getAbsolutePath()); + cc.setValue(ServerControlPlugin.PROP_PROGRAM + ".stop", cs2.getAbsolutePath()); + log.debug("[getControlConfig] server=" + proc.getServer()); + log.debug("[getControlConfig] cc=" + cc); + return cc; + } + protected void initDetector(File root) { //sadly, the setupCmdLine script is the //best way to determine the node name @@ -401,17 +412,6 @@ server.setIdentifier(proc.getIdentifier()); server.setName(getPlatformName() + " " + type + " " + proc.getServerName()); - ConfigResponse controlConfig = null; - - if (!isServiceControl()) { - File controlScript = new File( proc.getServerRoot(), getStartupScript()); - Properties controlProps = new Properties(); - controlProps.setProperty(ServerControlPlugin.PROP_PROGRAM, - controlScript.getAbsolutePath()); - controlConfig = - new ConfigResponse(controlProps); - } - ConfigResponse productConfig = new ConfigResponse(getProductConfig(proc)); @@ -428,16 +428,13 @@ //this will make sure only 1 gets auto-enabled for metrics/ai server.setConnectProperties(METRIC_CONNECT_PROPS); - server.setProductConfig(productConfig); + setProductConfig(server, productConfig); server.setMeasurementConfig(); - if (controlConfig != null) { - server.setControlConfig(controlConfig); - } + setControlConfig(server, getControlConfig(proc)); servers.add(server); - this.log.debug("Detected " + server.getName() + - " in " + serverDir); + log.debug("Detected " + server.getName() + " in " + serverDir); return servers; } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -47,6 +47,10 @@ MetricUnreachableException, MetricNotFoundException { + if(!WebsphereProductPlugin.VALID_JVM) + throw new MetricUnreachableException("The WebSphere plugin needs a IBM JVM !!! " + + "(agent jvm=" + System.getProperty("java.vm.vendor") + ")"); + if (useJMX()) { return super.getValue(metric); //collector } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -33,6 +33,7 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; @@ -46,10 +47,12 @@ import org.apache.commons.logging.LogFactory; import org.hyperic.hq.product.ProductPlugin; import org.hyperic.hq.product.ProductPluginManager; +import org.hyperic.sigar.OperatingSystem; import org.hyperic.sigar.win32.RegistryKey; import org.hyperic.sigar.win32.Win32Exception; public class WebsphereProductPlugin extends ProductPlugin { + public static boolean VALID_JVM=true; public static final String NAME = "websphere"; @@ -119,26 +122,19 @@ //if we are running with the ibm jdk we can configure //websphere.installpath ourselves. private static String getInstallPathFromJDK() { - String vendor = System.getProperty("java.vendor"); - - if (!vendor.startsWith("IBM")) { - return null; + String res = null; + if (VALID_JVM) { + String javaHome = System.getProperty("java.home"); + File dir = new File(javaHome); + do { + if (!new File(dir, "profiles").exists()) { + dir = dir.getParentFile(); + } else { + res = dir.getAbsolutePath(); + } + } while ((res == null) && (dir.getParentFile() != null)); } - - String javaHome = System.getProperty("java.home"); - - File dir = new File(javaHome); - - //exists in both 4.0 and 5.0 - final String jar = "lib" + File.separator + "websphere-validation.jar"; - - while ((dir = dir.getParentFile()) != null) { - if (new File(dir, jar).exists()) { - return dir.getAbsolutePath(); - } - } - - return null; + return res; } /** @@ -215,6 +211,9 @@ dir = root + "/IBM/WebSphere/AppServer"; if (!new File(dir).isDirectory()) { dir = root + "/WebSphere/AppServer"; + if (!new File(dir).isDirectory()) { + dir=null; + } } where = "default location"; } @@ -225,7 +224,7 @@ return null; } else { - log.debug(PROP_INSTALLPATH + " configured using " + where); + log.debug(PROP_INSTALLPATH + " configured using " + where+" ("+dir+")"); return dir; } } @@ -438,6 +437,18 @@ } public String[] getClassPath(ProductPluginManager manager) { + OperatingSystem os = OperatingSystem.getInstance(); + boolean testIBMJDK = (os.getName().equals(OperatingSystem.NAME_LINUX) + || os.getName().equals(OperatingSystem.NAME_WIN32)); + assert testIBMJDK : os.getName(); + if (testIBMJDK) { + VALID_JVM = System.getProperty("java.vm.vendor").toUpperCase().indexOf("IBM") != -1; + if (!VALID_JVM) { + log.error("The WebSphere plugin needs a IBM JVM !!! " + + "(agent jvm=" + System.getProperty("java.vm.vendor") + ")"); + } + } + if (isWin32()) { String prop = "websphere.regkey"; REG_KEY = getProperties().getProperty(prop); @@ -450,7 +461,7 @@ Properties managerProps = manager.getProperties(); autoRT = "true".equals(managerProps.getProperty("websphere.autort")); - + useJMX = !"false".equals(managerProps.getProperty("websphere.usejmx")); final String propKey = "websphere.useext"; Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -87,6 +87,10 @@ this.name = null; } } + + // check server properties. + Stats stats =(Stats) getStats(mServer, this.name); + } public void collect() { @@ -101,23 +105,28 @@ setAvailability(true); - if (this.name != null) { - Stats stats =(Stats) getStats(mServer, this.name); + try { + if (this.name != null) { + Stats stats =(Stats) getStats(mServer, this.name); - if (stats != null) { - if (isJVM) { - double total = getStatCount(stats, "HeapSize"); - double used = getStatCount(stats, "UsedMemory"); - setValue("totalMemory", total); - setValue("usedMemory", used); - setValue("freeMemory", total-used); + if (stats != null) { + if (isJVM) { + double total = getStatCount(stats, "HeapSize"); + double used = getStatCount(stats, "UsedMemory"); + setValue("totalMemory", total); + setValue("usedMemory", used); + setValue("freeMemory", total-used); + } + else { + collectStatCount(stats, this.attrs); + } + }else{ + log.debug("no Stats"); } - else { - collectStatCount(stats, this.attrs); - } - }else{ - log.debug("no Stats"); } + } catch (PluginException e) { + setAvailability(false); + setMessage(e.getMessage()); } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -126,10 +126,21 @@ AdminClient mServer; WebsphereStopWatch timer = new WebsphereStopWatch(); + // http://blogs.sun.com/sunabl/entry/websphere_application_server_and_jvm ???? + // XXX test it with solaris version. try { mServer = AdminClientFactory.createAdminClient(props); - } catch (ConnectorException e) { + } catch (LinkageError e) { + log.error("!!! Incorrect JVM !!!", e); throw new MetricUnreachableException(e.getMessage(), e); + } catch (ConnectorException ex) { + Throwable e = ex; + while ((e = (Throwable) e.getCause()) != null) { + if (e instanceof LinkageError) { + throw new MetricUnreachableException("!!! Incorrect JVM !!!", e); + } + } + throw new MetricUnreachableException(ex.getMessage(), ex); } if (log.isDebugEnabled() && timer.isTooLong()) { Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -81,25 +81,7 @@ return WebsphereProductPlugin.PROP_SERVER_NAME; } - public Properties getProperties() { - Properties props = getParent().getProperties(); - configure(props); - - String controlScript = - this.installpath + - File.separator + "bin" + - File.separator + "startServer" + - GenericPlugin.getScriptExtension(); - - props.setProperty(WebsphereControlPlugin.PROP_PROGRAM, - controlScript); - - return props; - } - public Properties getMetricProperties() { - //cant fucking believe this is not available via jmx - //parse app server port out of server.xml final String addr = "<address xmi:id=\"EndPoint_1\""; String name = getName(); String node = getParent().getName(); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -46,8 +46,10 @@ import com.ibm.websphere.management.AdminClient; import com.ibm.websphere.management.exception.ConnectorException; +import java.io.File; import org.hyperic.hq.plugin.websphere.WebSphereProcess; import org.hyperic.hq.plugin.websphere.WebsphereDetector; +import org.hyperic.hq.product.ServerControlPlugin; import org.hyperic.hq.product.ServerResource; /** @@ -154,7 +156,8 @@ } catch (MetricUnreachableException e) { throw new PluginException(e.getMessage(), e); } catch (ConnectorException e) { - throw new PluginException(e.getMessage(), e); + if(log.isDebugEnabled()) + log.error(e.getMessage(),e); } return res; @@ -326,10 +329,9 @@ this.log.debug("discovered server: " + server.getName()); - server.setProductConfig(productConfig); server.setMeasurementConfig(new ConfigResponse(serverQuery.getMetricProperties())); - server.setControlConfig(new ConfigResponse()); + server.setControlConfig(serverDetector.getControlConfig(proc)); server.setCustomProperties(new ConfigResponse(serverQuery.getCustomProperties())); ArrayList services = new ArrayList(); |
From: <sc...@hy...> - 2010-04-16 18:41:08
|
Author: scottmf Date: 2010-04-16 11:40:59 -0700 (Fri, 16 Apr 2010) New Revision: 14512 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14512 Modified: trunk/tools/dbmigrate/src/DatabaseExport.java Log: cleanup code Modified: trunk/tools/dbmigrate/src/DatabaseExport.java =================================================================== --- trunk/tools/dbmigrate/src/DatabaseExport.java 2010-04-16 08:03:56 UTC (rev 14511) +++ trunk/tools/dbmigrate/src/DatabaseExport.java 2010-04-16 18:40:59 UTC (rev 14512) @@ -32,7 +32,6 @@ public class DatabaseExport { private static Map<String, Long> _seqMap = new HashMap<String, Long>(); - private static String _url; private static List<String> _tables; private static String _workingDir; private static boolean _debug; @@ -273,21 +272,25 @@ } private static Connection getConnectionExport() throws Exception { - _url = _sourceUrl + "?protocolVersion=2"; + String url = (_sourceUrl.contains("?")) ? + _sourceUrl + "&protocolVersion=2" : + _sourceUrl + "?protocolVersion=2"; Driver driver = (Driver)Class.forName("org.postgresql.Driver").newInstance(); Properties props = new Properties(); props.setProperty("user",_sourceUser); props.setProperty("password",_sourcePass); - return driver.connect(_url, props); + return driver.connect(url, props); } private static Connection getConnectionImport() throws Exception { - _url = _targetUrl + "?rewriteBatchedStatements=true&sessionVariables=FOREIGN_KEY_CHECKS=0"; + String url = (_targetUrl.contains("?")) ? + _targetUrl + "&rewriteBatchedStatements=true&sessionVariables=FOREIGN_KEY_CHECKS=0" : + _targetUrl + "?rewriteBatchedStatements=true&sessionVariables=FOREIGN_KEY_CHECKS=0"; Driver driver = (Driver)Class.forName("com.mysql.jdbc.Driver").newInstance(); Properties props = new Properties(); props.setProperty("user",_targetUser); props.setProperty("password",_targetPass); - return driver.connect(_url, props); + return driver.connect(url, props); } private static Collection<BigTable> getBigTables() |