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: <bo...@hy...> - 2009-10-28 00:35:31
|
Author: bob Date: 2009-10-27 17:35:11 -0700 (Tue, 27 Oct 2009) New Revision: 13909 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13909 Modified: trunk/etc/version.properties Log: Release 4.2.0 build #1257 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-10-27 23:20:13 UTC (rev 13908) +++ trunk/etc/version.properties 2009-10-28 00:35:11 UTC (rev 13909) @@ -1,3 +1,3 @@ -#Sat Oct 24 23:48:47 PDT 2009 +#Tue Oct 27 16:51:26 PDT 2009 version=4.2.0 -build=1256 +build=1257 |
From: <kp...@hy...> - 2009-10-27 23:20:25
|
Author: kparikh Date: 2009-10-27 16:20:13 -0700 (Tue, 27 Oct 2009) New Revision: 13908 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13908 Modified: trunk/build.xml Log: [HHQ-3502] Added missing jaxb libs for updated vim plugin Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2009-10-27 22:33:50 UTC (rev 13907) +++ trunk/build.xml 2009-10-27 23:20:13 UTC (rev 13908) @@ -1003,6 +1003,9 @@ <include name="xmlrpc-client-3.1.jar"/> <include name="xmlrpc-common-3.1.jar"/> <include name="ws-commons-util-1.0.2.jar"/> + <!-- for vim plugin using vijava 2.0 --> + <include name="com.springsource.com.sun.xml.bind-2.1.7.jar"/> + <include name="com.springsource.javax.xml.bind-2.1.7.jar"/> </fileset> <fileset dir="${tapestry_lib}"> <!-- for CollectorThread --> |
From: <pn...@hy...> - 2009-10-27 22:34:03
|
Author: pnguyen Date: 2009-10-27 15:33:50 -0700 (Tue, 27 Oct 2009) New Revision: 13907 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13907 Modified: trunk/etc/startup_classes.txt Log: [HHQ-3503] start RegisteredTriggerStartupListener after the EventsStartupListener since the EventsStartupListener does trigger cleanup work. Modified: trunk/etc/startup_classes.txt =================================================================== --- trunk/etc/startup_classes.txt 2009-10-27 22:31:28 UTC (rev 13906) +++ trunk/etc/startup_classes.txt 2009-10-27 22:33:50 UTC (rev 13907) @@ -7,9 +7,9 @@ org.hyperic.hq.livedata.server.session.LiveDataStartupListener org.hyperic.hq.measurement.server.session.MeasurementStartupListener org.hyperic.hq.bizapp.server.session.BossStartupListener -org.hyperic.hq.events.server.session.RegisteredTriggerStartupListener org.hyperic.hq.galerts.server.session.GalertStartupListener org.hyperic.hq.events.server.session.EventsStartupListener +org.hyperic.hq.events.server.session.RegisteredTriggerStartupListener org.hyperic.hq.ui.server.session.UIStartupListener org.hyperic.hq.escalation.server.session.EscalationStartupListener org.hyperic.hq.control.server.session.ControlStartupListener |
From: <pn...@hy...> - 2009-10-27 22:31:39
|
Author: pnguyen Date: 2009-10-27 15:31:28 -0700 (Tue, 27 Oct 2009) New Revision: 13906 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13906 Modified: trunk/installer/data/db-upgrade.xml trunk/src/org/hyperic/hq/events/server/session/TriggerDAO.java Log: [HHQ-3503] do not get triggers of deleted alert definitions; cleanup deleted alert definitions in db-upgrade script Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2009-10-25 07:28:52 UTC (rev 13905) +++ trunk/installer/data/db-upgrade.xml 2009-10-27 22:31:28 UTC (rev 13906) @@ -10868,6 +10868,17 @@ </schema-directSQL> </schemaSpec> + <schemaSpec version="3.193"> + <schema-directSQL> + <statement desc="Cleanup deleted alert definitions"> + UPDATE EAM_ALERT_DEFINITION + SET ACTIVE = '0', ENABLED = '0' + WHERE DELETED = '1' + AND (ACTIVE = '1' OR ENABLED = '1') + </statement> + </schema-directSQL> + </schemaSpec> + </dbupgrade> </target> </project> Modified: trunk/src/org/hyperic/hq/events/server/session/TriggerDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/TriggerDAO.java 2009-10-25 07:28:52 UTC (rev 13905) +++ trunk/src/org/hyperic/hq/events/server/session/TriggerDAO.java 2009-10-27 22:31:28 UTC (rev 13906) @@ -162,7 +162,8 @@ .append("join fetch ad.alertDefinitionState ") .append("join fetch ad.conditionsBag c ") .append("join fetch c.trigger ") - .append("where ad.enabled = '1'") + .append("where ad.enabled = '1' ") + .append("and ad.deleted = '0' ") .toString(); if (debug) watch.markTimeBegin("createQuery.list"); |
From: <no...@gi...> - 2009-10-27 22:15:45
|
Branch: refs/heads/evolution Home: http://github.com/hyperic/hqapi Commit: aab6169e7b6fa5c4e4d3c8c203cb54d4a2dad41d http://github.com/hyperic/hqapi/commit/aab6169e7b6fa5c4e4d3c8c203cb54d4a2dad41d Author: Jennifer Hickey <jen...@sp...> Date: 2009-10-27 (Tue, 27 Oct 2009) Changed paths: M hqu/hqapi1/app/AlertController.groovy Log Message: ----------- HE-109. Converted AlertManagerEJB |
From: Doug M. <do...@hy...> - 2009-10-27 21:07:33
|
ProcCpu.getLastTime is actually an internal field that we shouldn't be public. If you're looking to measure how long the process has been running: System.currentTimeMillis() - procTime.getStartTime(); The value of majorfaults + minorfaults on Mac + Windows should actually be -1 (Sigar.FIELD_NOTIMPL). The javadoc for minor/major faults notes: Supported Platforms: AIX, HPUX, Linux, Solaris. |
From: hyperguy <sig...@hy...> - 2009-10-27 19:01:12
|
Just to answer my own question - though, it would be nice to get feedback from a guru to see if this is the "right" approach. Basically, I spawned a thread that created its own instance of a sigar object. Within the thread, it calls something like this: while (condition) { procTime = sigar.getProcCpu(pid); procMem = sigar.getProcMem(pid); long currentResident = procMem.getResident(); if (((int) currentResident) > pData.memorySize) { pData.memorySize = (int) currentResident; } long pageFaults = procMem.getPageFaults(); if (pageFaults > pData.pageFaults) { pData.pageFaults = pageFaults; } long minorFaults = procMem.getMinorFaults(); if (minorFaults > pData.minorFaults) { pData.minorFaults = minorFaults; } long majorFaults = procMem.getMajorFaults(); if (majorFaults > pData.majorFaults) { pData.majorFaults = majorFaults; } pData.cpuTime = procTime.getTotal(); pData.userTime = procTime.getUser(); pData.systemTime = procTime.getSys(); pData.exeTime = procTime.getLastTime() - procTime.getStartTime(); count++; sleep(100); } So over a given period of time, cpu and memory stats are collected. The pDate.exe time stat is weird. I would expect that the exeTime would be greater than the cpuTime number. HOWEVER, at least on windows and mac, the exeTime is SMALLER than cpuTime. Using windows api's (non-sigar), the opposite is true, i.e. exeTime > cpuTime using windows api's. Is there any reason to account for this difference? This discrepancy is giving me doubts on trusting the sigar produced numbers. In addition, on both windows and mac, the major faults and minor faults are always 0. According to the docs, pagefaults = majorfaults + minorfaults, but pagefaults is never 0. I'm using windows xp professional and mac os x snow leopard. |
From: <no...@gi...> - 2009-10-27 18:00:24
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 8b2cc31e6858c6a775849a1d7f5c65bb94819bea http://github.com/hyperic/hqapi/commit/8b2cc31e6858c6a775849a1d7f5c65bb94819bea Author: pnguyen <pnguyen@10.2.0.125> Date: 2009-10-27 (Tue, 27 Oct 2009) Changed paths: M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncThresholdCondition_test.java Log Message: ----------- Undo checkin of uncommited dependency |
From: <no...@gi...> - 2009-10-27 17:54:51
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 1d1e8faf5e5d67d882c2f234f88827f7ca685d55 http://github.com/hyperic/hqapi/commit/1d1e8faf5e5d67d882c2f234f88827f7ca685d55 Author: pnguyen <pnguyen@10.2.0.125> Date: 2009-10-27 (Tue, 27 Oct 2009) Changed paths: M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncBaselineCondition_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncConfigCondition_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncControlCondition_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncLogCondition_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncMetricChangeCondition_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncPropertyCondition_test.java M src/org/hyperic/hq/hqapi1/test/AlertDefinitionSyncThresholdCondition_test.java Log Message: ----------- Validate the alert definition from the response |
From: <bo...@hy...> - 2009-10-25 07:29:05
|
Author: bob Date: 2009-10-25 00:28:52 -0700 (Sun, 25 Oct 2009) New Revision: 13905 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13905 Modified: trunk/etc/version.properties Log: Release 4.2.0 build #1256 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-10-25 02:19:21 UTC (rev 13904) +++ trunk/etc/version.properties 2009-10-25 07:28:52 UTC (rev 13905) @@ -1,3 +1,3 @@ -#Sat Oct 24 01:12:58 PDT 2009 +#Sat Oct 24 23:48:47 PDT 2009 version=4.2.0 -build=1255 +build=1256 |
From: <pn...@hy...> - 2009-10-25 02:19:39
|
Author: pnguyen Date: 2009-10-24 19:19:21 -0700 (Sat, 24 Oct 2009) New Revision: 13904 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13904 Modified: trunk/sql/measurement/Measurement.hbm.xml trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java Log: [HHQ-3475] use outer join and force hibernate to fetch baselinesBag Modified: trunk/sql/measurement/Measurement.hbm.xml =================================================================== --- trunk/sql/measurement/Measurement.hbm.xml 2009-10-24 08:48:43 UTC (rev 13903) +++ trunk/sql/measurement/Measurement.hbm.xml 2009-10-25 02:19:21 UTC (rev 13904) @@ -43,7 +43,7 @@ <column name="RESOURCE_ID"/> </many-to-one> - <bag inverse="true" cascade="all-delete-orphan" name="baselinesBag" table="EAM_MEASUREMENT_BL" fetch="join"> + <bag inverse="true" cascade="all-delete-orphan" name="baselinesBag" table="EAM_MEASUREMENT_BL"> <cache usage="read-write"/> <key on-delete="cascade" column="MEASUREMENT_ID"/> <one-to-many class="Baseline"/> Modified: trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-10-24 08:48:43 UTC (rev 13903) +++ trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-10-25 02:19:21 UTC (rev 13904) @@ -84,13 +84,12 @@ * retrieves List<Object[]> * [0] = Measurement * [1] = MeasurementTemplate - * [2] = Baseline */ List findAllEnabledMeasurementsAndTemplates() { String hql = new StringBuilder() .append("from Measurement m") .append(" join m.template t") - .append(" join m.baselinesBag b") + .append(" left outer join fetch m.baselinesBag b") .append(" where enabled = '1'") .toString(); return getSession().createQuery(hql).list(); |
From: <bo...@hy...> - 2009-10-24 08:48:57
|
Author: bob Date: 2009-10-24 01:48:43 -0700 (Sat, 24 Oct 2009) New Revision: 13903 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13903 Modified: trunk/etc/version.properties Log: Release 4.2.0 build #1255 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-10-24 00:35:23 UTC (rev 13902) +++ trunk/etc/version.properties 2009-10-24 08:48:43 UTC (rev 13903) @@ -1,3 +1,3 @@ -#Fri Oct 23 01:11:55 PDT 2009 +#Sat Oct 24 01:12:58 PDT 2009 version=4.2.0 -build=1254 +build=1255 |
From: <jh...@hy...> - 2009-10-24 00:35:37
|
Author: jhickey Date: 2009-10-23 17:35:23 -0700 (Fri, 23 Oct 2009) New Revision: 13902 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13902 Modified: trunk/.classpath trunk/installer/data/db-upgrade.xml trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java Log: HQ-1896 Changed AMS Health UI plugin to HQ Health UI plugin on upgrade. Fixed HHQ-3265 error preventing the "HQ Agent" server type from being created during plugin deploy (due to ObjectDeletedException when removing old "AMS Agent" server instance) Modified: trunk/.classpath =================================================================== --- trunk/.classpath 2009-10-23 23:05:53 UTC (rev 13901) +++ trunk/.classpath 2009-10-24 00:35:23 UTC (rev 13902) @@ -127,7 +127,6 @@ <classpathentry kind="lib" path="thirdparty/lib/mx4j/mx4j-rjmx.jar"/> <classpathentry kind="lib" path="thirdparty/lib/mx4j/mx4j-tools.jar"/> <classpathentry kind="lib" path="thirdparty/lib/mx4j/mx4j.jar"/> - <classpathentry kind="lib" path="thirdparty/lib/mysql_jdbc/mysql-connector-java-5.1.10-bin.jar"/> <classpathentry kind="lib" path="thirdparty/lib/oracle_jdbc/ojdbc14.jar"/> <classpathentry kind="lib" path="thirdparty/lib/oracle_jdbc/oracle12.jar"/> <classpathentry kind="lib" path="thirdparty/lib/postgresql/postgresql-7.4.3.jar"/> @@ -223,6 +222,5 @@ <classpathentry kind="lib" path="thirdparty/lib/com.springsource.com.sun.xml.bind-2.1.7.jar"/> <classpathentry kind="lib" path="thirdparty/lib/com.springsource.javax.xml.bind-2.1.7.jar"/> <classpathentry kind="lib" path="thirdparty/lib/com.springsource.javax.xml.stream-1.0.1.jar"/> - <classpathentry kind="lib" path="thirdparty/lib/mysql_jdbc/mysql-connector-java-5.1.10-bin.jar"/> <classpathentry kind="output" path="build/classes"/> </classpath> Modified: trunk/installer/data/db-upgrade.xml =================================================================== --- trunk/installer/data/db-upgrade.xml 2009-10-23 23:05:53 UTC (rev 13901) +++ trunk/installer/data/db-upgrade.xml 2009-10-24 00:35:23 UTC (rev 13902) @@ -10857,6 +10857,16 @@ columnType="VARCHAR2" nullable="NOT NULL" /> </schemaSpec> + + <schemaSpec version="3.192"> + <schema-directSQL> + <statement desc="Updating HQ Health Plugin"> + UPDATE EAM_UI_VIEW + SET DESCRIPTION='HQ Health' + WHERE DESCRIPTION='AMS Health' + </statement> + </schema-directSQL> + </schemaSpec> </dbupgrade> </target> Modified: trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java 2009-10-23 23:05:53 UTC (rev 13901) +++ trunk/src/org/hyperic/hq/appdef/server/session/ServerManagerEJBImpl.java 2009-10-24 00:35:23 UTC (rev 13902) @@ -520,6 +520,10 @@ platform.getServersBag().remove(server); } + //Remove Server from ServerType. If not done, results in an ObjectDeletedException + //when updating plugin types during plugin deployment + server.getServerType().getServers().remove(server); + // Keep config response ID so it can be deleted later. final ConfigResponseDB config = server.getConfigResponse(); |
From: <sc...@hy...> - 2009-10-23 23:06:05
|
Author: scottmf Date: 2009-10-23 16:05:53 -0700 (Fri, 23 Oct 2009) New Revision: 13901 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13901 Modified: trunk/etc/startup_classes.txt trunk/sql/measurement/Measurement.hbm.xml trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java Log: [HHQ-3475] prefetch baselinesBag, reorder startup sequence to ensure that prefetched objects may be taken advantage of Modified: trunk/etc/startup_classes.txt =================================================================== --- trunk/etc/startup_classes.txt 2009-10-23 22:24:38 UTC (rev 13900) +++ trunk/etc/startup_classes.txt 2009-10-23 23:05:53 UTC (rev 13901) @@ -1,5 +1,4 @@ org.hyperic.hq.product.server.session.ProductStartupListener -org.hyperic.hq.events.server.session.RegisteredTriggerStartupListener org.hyperic.hq.authz.server.session.GroupingStartupListener org.hyperic.hq.authz.server.session.AuthzStartupListener org.hyperic.hq.common.server.session.CommonStartupListener @@ -7,12 +6,13 @@ org.hyperic.hq.autoinventory.server.session.AIStartupListener org.hyperic.hq.livedata.server.session.LiveDataStartupListener org.hyperic.hq.measurement.server.session.MeasurementStartupListener +org.hyperic.hq.bizapp.server.session.BossStartupListener +org.hyperic.hq.events.server.session.RegisteredTriggerStartupListener org.hyperic.hq.galerts.server.session.GalertStartupListener org.hyperic.hq.events.server.session.EventsStartupListener org.hyperic.hq.ui.server.session.UIStartupListener org.hyperic.hq.escalation.server.session.EscalationStartupListener org.hyperic.hq.control.server.session.ControlStartupListener -org.hyperic.hq.bizapp.server.session.BossStartupListener org.hyperic.hq.ha.server.session.HAStartupListener org.hyperic.hq.events.server.session.HeartBeatServiceStartupListener org.hyperic.hq.events.server.session.HQDBHealthStartupListener Modified: trunk/sql/measurement/Measurement.hbm.xml =================================================================== --- trunk/sql/measurement/Measurement.hbm.xml 2009-10-23 22:24:38 UTC (rev 13900) +++ trunk/sql/measurement/Measurement.hbm.xml 2009-10-23 23:05:53 UTC (rev 13901) @@ -43,7 +43,7 @@ <column name="RESOURCE_ID"/> </many-to-one> - <bag inverse="true" cascade="all-delete-orphan" name="baselinesBag" table="EAM_MEASUREMENT_BL"> + <bag inverse="true" cascade="all-delete-orphan" name="baselinesBag" table="EAM_MEASUREMENT_BL" fetch="join"> <cache usage="read-write"/> <key on-delete="cascade" column="MEASUREMENT_ID"/> <one-to-many class="Baseline"/> Modified: trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-10-23 22:24:38 UTC (rev 13900) +++ trunk/src/org/hyperic/hq/measurement/server/session/MeasurementDAO.java 2009-10-23 23:05:53 UTC (rev 13901) @@ -80,17 +80,18 @@ } /** + * Used primarily for preloaded 2nd level cache measurement objects * retrieves List<Object[]> * [0] = Measurement * [1] = MeasurementTemplate + * [2] = Baseline */ List findAllEnabledMeasurementsAndTemplates() { - Dialect dialect = Util.getDialect(); String hql = new StringBuilder() .append("from Measurement m") .append(" join m.template t") - .append(" where enabled = ") - .append(dialect.toBooleanValueString(true)) + .append(" join m.baselinesBag b") + .append(" where enabled = '1'") .toString(); return getSession().createQuery(hql).list(); } |
From: Doug M. <do...@hy...> - 2009-10-23 22:49:38
|
If its linux running on mips, possibly, but you'd need to build from source. Can you give us more details? |
From: Doug M. <do...@hy...> - 2009-10-23 22:48:13
|
Hi Chris, DiskUsage.java is generated by the build system. The code is actually in linux_sigar.c The issue is likely file system -> device mapping: % java -Dsigar.nativeLogging=true -jar sigar.jar iostat / Filesystem Mounted on Reads Writes R-bytes W-bytes Queue Svctm 0 [main] DEBUG Sigar - [iodev] map / -> /dev/sda2 3 [main] DEBUG Sigar - [iodev] map /boot -> /dev/sda1 3 [main] DEBUG Sigar - [iodev] map /data -> /dev/sda5 3 [main] DEBUG Sigar - /proc/diskstats / -> /dev/sda2 [8,2] /dev/sda2 / 1522729 3748132 10G 14G 0.96 3.66 The iostat command also accepts the device name, does this work for you? % java -jar sigar.jar iostat sda Filesystem Mounted on Reads Writes R-bytes W-bytes Queue Svctm sda - 26260315 15559442 433G 644G 0.97 3.66 |
From: <pn...@hy...> - 2009-10-23 22:24:52
|
Author: pnguyen Date: 2009-10-23 15:24:38 -0700 (Fri, 23 Oct 2009) New Revision: 13900 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13900 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java Log: [HQ-1894] While creating and updating alert defs, create (if necessary) the EnableAlertDefAction alert action for recovery alerts and the MetricAlertAction alert action for threshold, change, and baseline condition types. Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-10-23 08:44:31 UTC (rev 13899) +++ trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2009-10-23 22:24:38 UTC (rev 13900) @@ -458,6 +458,9 @@ adval.setAppdefId(aetid.getId()); adval.setParentId(EventConstants.TYPE_ALERT_DEF_ID); + // Create a measurement AlertLogAction if necessary + setMetricAlertAction(adval); + // Now create the alert definition if (debug) watch.markTimeBegin("createParentAlertDefinition"); parent = getADM().createAlertDefinition(subject, adval); @@ -531,9 +534,6 @@ // Make sure the actions have the proper parentId cloneParentActions(id, adval, parent.getActions()); - // Create a measurement AlertLogAction if necessary - setMetricAlertAction(adval); - // Now create the alert definition if (debug) childWatch.markTimeBegin("createAlertDefinition"); AlertDefinitionValue newAdval = adm.createAlertDefinition(subject, adval); @@ -560,6 +560,21 @@ return parent; } + /** + * Get the MetricAlertAction ActionValue from an + * AlertDefinitionValue. If none exists, return null. + */ + private ActionValue getMetricAlertAction(AlertDefinitionValue adv) { + ActionValue[] actions = adv.getActions(); + for (int i = 0; i < actions.length; ++i) { + String actionClass = actions[i].getClassname(); + if (MetricAlertAction.class.getName().equals(actionClass)) { + return actions[i]; + } + } + return null; + } + private void setMetricAlertAction(AlertDefinitionValue adval) { AlertConditionValue[] conds = adval.getConditions(); for (int i = 0; i < conds.length; i++) { @@ -567,19 +582,25 @@ conds[i].getType() == EventConstants.TYPE_BASELINE || conds[i].getType() == EventConstants.TYPE_CHANGE) { - ActionValue action = new ActionValue(); - action.setClassname(MetricAlertAction.class.getName()); + ActionValue action = getMetricAlertAction(adval); + + // if MetricAlertAction doesn't exist, add one + if (action == null) { + action = new ActionValue(); + action.setClassname(MetricAlertAction.class.getName()); - ConfigResponse config = new ConfigResponse(); - try { - action.setConfig(config.encode()); - } catch (EncodingException e) { - // This should never happen - _log.error("Empty ConfigResponse threw an encoding error", - e); + ConfigResponse config = new ConfigResponse(); + try { + action.setConfig(config.encode()); + } catch (EncodingException e) { + // This should never happen + _log.error("Empty ConfigResponse threw an encoding error", + e); + } + + adval.addAction(action); } - - adval.addAction(action); + break; } } @@ -816,6 +837,9 @@ adval.getAppdefType() == AppdefEntityConstants.APPDEF_TYPE_GROUP) { // A little more work to do for group and type alert definition + // Create a measurement AlertLogAction if necessary + setMetricAlertAction(adval); + if (debug) watch.markTimeBegin("updateParentAlertDefinition"); adval = adm.updateAlertDefinition(adval); @@ -894,6 +918,9 @@ // Now create the new triggers createTriggers(subject, adval); + // Create a measurement AlertLogAction if necessary + setMetricAlertAction(adval); + // Now update the alert definition adm.updateAlertDefinition(adval); } Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-10-23 08:44:31 UTC (rev 13899) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2009-10-23 22:24:38 UTC (rev 13900) @@ -273,25 +273,7 @@ } if (cond.getType() == EventConstants.TYPE_ALERT) { - ActionValue recoverAction = new ActionValue(); - - EnableAlertDefActionConfig action = - new EnableAlertDefActionConfig(); - action.setAlertDefId(cond.getMeasurementId()); - - recoverAction.setClassname(action.getImplementor()); - try { - recoverAction - .setConfig(action.getConfigResponse().encode()); - } catch (EncodingException e) { - log.debug("Error encoding EnableAlertDefAction", e); - } catch (InvalidOptionException e) { - log.debug("Error encoding EnableAlertDefAction", e); - } catch (InvalidOptionValueException e) { - log.debug("Error encoding EnableAlertDefAction", e); - } - - a.addAction(recoverAction); + setEnableAlertDefAction(a, cond.getMeasurementId()); } acDAO.save(cond); @@ -408,7 +390,7 @@ * Get the EnableAlertDefAction ActionValue from an * AlertDefinitionValue. If none exists, return null. */ - private ActionValue getEnableAction(AlertDefinitionValue adv) { + private ActionValue getEnableAlertDefAction(AlertDefinitionValue adv) { ActionValue[] actions = adv.getActions(); EnableAlertDefActionConfig cfg = new EnableAlertDefActionConfig(); for (int i = 0; i < actions.length; ++i) { @@ -419,6 +401,53 @@ return null; } + private void setEnableAlertDefAction(AlertDefinitionValue adval, int recoverId) { + EnableAlertDefActionConfig action = + new EnableAlertDefActionConfig(); + + // Find recovery actions first + ActionValue recoverAction = getEnableAlertDefAction(adval); + + if (recoverAction != null) { + try { + ConfigResponse configResponse = + ConfigResponse.decode(recoverAction.getConfig()); + action.init(configResponse); + + if (action.getAlertDefId() != recoverId) { + action.setAlertDefId(recoverId); + recoverAction.setConfig(action + .getConfigResponse() + .encode()); + adval.updateAction(recoverAction); + } + } catch (Exception e) { + adval.removeAction(recoverAction); + recoverAction = null; + } + } + + // Add action if doesn't exist + if (recoverAction == null) { + recoverAction = new ActionValue(); + action.setAlertDefId(recoverId); + recoverAction.setClassname(action.getImplementor()); + + try { + recoverAction + .setConfig(action.getConfigResponse().encode()); + } catch (EncodingException e) { + log.debug("Error encoding EnableAlertDefAction", e); + } catch (InvalidOptionException e) { + log.debug("Error encoding EnableAlertDefAction", e); + } catch (InvalidOptionValueException e) { + log.debug("Error encoding EnableAlertDefAction", e); + } + + adval.addAction(recoverAction); + } + } + /** * Update an alert definition * @ejb:interface-method @@ -430,11 +459,8 @@ AlertDefinitionDAO dao = getAlertDefDAO(); ActionDAO actDao = getActionDAO(); AlertDefinition aldef = dao.findById(adval.getId()); - - // Find recovery actions first - ActionValue recoverAction = getEnableAction(adval); - adval.removeAction(recoverAction); - + int recoverId = -1; + // See if the conditions changed if (adval.getAddedConditions().size() > 0 || adval.getUpdatedConditions().size() > 0 || @@ -452,61 +478,34 @@ if (conds[i].getTriggerId() != null) trigger = registeredTriggerManager.findById(conds[i].getTriggerId()); - if (conds[i].getType() == EventConstants.TYPE_ALERT) { - EnableAlertDefActionConfig action = - new EnableAlertDefActionConfig(); - if (recoverAction != null) { - try { - ConfigResponse configResponse = - ConfigResponse.decode(recoverAction.getConfig()); - action.init(configResponse); - - if (action.getAlertDefId() != - conds[i].getMeasurementId()) { - action.setAlertDefId(conds[i].getMeasurementId()); - recoverAction.setConfig(action - .getConfigResponse() - .encode()); - adval.updateAction(recoverAction); - } - } catch (Exception e) { - recoverAction = null; - } - } - - // Add action if doesn't exist - if (recoverAction == null) { - recoverAction = new ActionValue(); - action.setAlertDefId(conds[i].getMeasurementId()); - recoverAction.setClassname(action.getImplementor()); - - try { - recoverAction - .setConfig(action.getConfigResponse().encode()); - } catch (EncodingException e) { - log.debug("Error encoding EnableAlertDefAction", e); - } catch (InvalidOptionException e) { - log.debug("Error encoding EnableAlertDefAction", e); - } catch (InvalidOptionValueException e) { - log.debug("Error encoding EnableAlertDefAction", e); - } - - adval.addAction(recoverAction); - } + if (conds[i].getType() == EventConstants.TYPE_ALERT) { + recoverId = conds[i].getMeasurementId(); } aldef.createCondition(conds[i], trigger); } } + + if (recoverId > 0) { + setEnableAlertDefAction(adval, recoverId); + } else { + // Remove recover action if exists + ActionValue recoverAction = getEnableAlertDefAction(adval); + if (recoverAction != null) { + adval.removeAction(recoverAction); + } + } + // See if the actions changed if (adval.getAddedActions().size() > 0 || adval.getUpdatedActions().size() > 0 || - adval.getRemovedActions().size() > 0) + adval.getRemovedActions().size() > 0 || + adval.getActions().length != aldef.getActions().size()) { // We need to keep old actions around for the logs. So // we'll create new actions and update the alert - // definition, but we won't remove the old conditions. + // definition, but we won't remove the old actions. ActionValue[] actions = adval.getActions(); aldef.clearActions(); for (int i = 0; i < actions.length; i++) { |
From: <no...@gi...> - 2009-10-23 17:52:34
|
Branch: refs/heads/master Home: http://github.com/hyperic/hqapi Commit: 2b78d3e78a3f09fc722fe9a0c039df18d4db5eb6 http://github.com/hyperic/hqapi/commit/2b78d3e78a3f09fc722fe9a0c039df18d4db5eb6 Author: pnguyen <pnguyen@10.2.0.125> Date: 2009-10-23 (Fri, 23 Oct 2009) Changed paths: M src/org/hyperic/hq/hqapi1/test/ResourceCreatePlatform_test.java Log Message: ----------- Temporarily disable the testCreatePlatform test until HHQ-3435 is fixed |
From: <bo...@hy...> - 2009-10-23 08:44:45
|
Author: bob Date: 2009-10-23 01:44:31 -0700 (Fri, 23 Oct 2009) New Revision: 13899 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13899 Modified: trunk/etc/version.properties Log: Release 4.2.0 build #1254 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-10-23 00:24:29 UTC (rev 13898) +++ trunk/etc/version.properties 2009-10-23 08:44:31 UTC (rev 13899) @@ -1,3 +1,3 @@ -#Thu Oct 22 13:52:17 PDT 2009 +#Fri Oct 23 01:11:55 PDT 2009 version=4.2.0 -build=1253 +build=1254 |
From: <dcr...@hy...> - 2009-10-23 00:56:07
|
Author: dcrutchf Date: 2009-10-22 17:24:29 -0700 (Thu, 22 Oct 2009) New Revision: 13898 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13898 Modified: trunk/src/org/hyperic/hq/authz/shared/PermissionManager.java trunk/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java Log: [HQ-1499] - User with no alerting access can view alerts/events in Event Center Modified: trunk/src/org/hyperic/hq/authz/shared/PermissionManager.java =================================================================== --- trunk/src/org/hyperic/hq/authz/shared/PermissionManager.java 2009-10-22 21:36:42 UTC (rev 13897) +++ trunk/src/org/hyperic/hq/authz/shared/PermissionManager.java 2009-10-23 00:24:29 UTC (rev 13898) @@ -206,12 +206,14 @@ public interface RolePermNativeSQL { String getSQL(); - Query bindParams(Query q, AuthzSubject subject, List operations); + Query bindParams(Query q, AuthzSubject subject, List viewResourcesOperations, List manageAlertOperations); } public abstract RolePermNativeSQL - getRolePermissionNativeSQL(String resourceVar, String subjectParam, - String opListParam); + getRolePermissionNativeSQL(String resourceVar, String eventLogVar, + String subjectParam, + String opListViewResourcesParam, + String opListManageAlertsParam); public abstract String getAlertsHQL(boolean inEscalation, boolean notFixed, Modified: trunk/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java =================================================================== --- trunk/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java 2009-10-22 21:36:42 UTC (rev 13897) +++ trunk/src/org/hyperic/hq/authz/shared/PermissionManagerImpl.java 2009-10-23 00:24:29 UTC (rev 13898) @@ -368,15 +368,17 @@ } public RolePermNativeSQL getRolePermissionNativeSQL(String resourceVar, + String eventLogVar, String subjectParam, - String opListParam) + String opListViewResourcesParam, + String opListManageAlertsParam) { return new RolePermNativeSQL() { public String getSQL() { return ""; } - public Query bindParams(Query q, AuthzSubject subject, List ops) { + public Query bindParams(Query q, AuthzSubject subject, List opsViewResources, List opsManageAlerts) { return q; } }; Modified: trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-10-22 21:36:42 UTC (rev 13897) +++ trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-10-23 00:24:29 UTC (rev 13898) @@ -67,9 +67,17 @@ AuthzConstants.platformOpViewPlatform, AuthzConstants.serverOpViewServer, AuthzConstants.serviceOpViewService, - AuthzConstants.groupOpViewResourceGroup, + AuthzConstants.groupOpViewResourceGroup }); + private static final List MANAGE_ALERT_PERMISSIONS = + Arrays.asList(new String[] { + AuthzConstants.platformOpManageAlerts, + AuthzConstants.serverOpManageAlerts, + AuthzConstants.serviceOpManageAlerts, + AuthzConstants.groupOpManageAlerts + }); + public EventLogDAO(DAOFactory f) { super(EventLog.class, f); } @@ -143,7 +151,7 @@ RolePermNativeSQL roleSql = PermissionManagerFactory .getInstance() - .getRolePermissionNativeSQL("r", "subject", "opList"); + .getRolePermissionNativeSQL("r", "e", "subject", "opListVR", "opListMA"); if (inGroups == null || inGroups.isEmpty()) @@ -194,7 +202,7 @@ .setLong("begin", begin) .setLong("end", end) .setInteger("maxStatus", maxStatus.getCode()); - roleSql.bindParams(q, subject, VIEW_PERMISSIONS); + roleSql.bindParams(q, subject, VIEW_PERMISSIONS, MANAGE_ALERT_PERMISSIONS); if (typeClass != null) { q.setString("type", typeClass); |
From: <sc...@hy...> - 2009-10-22 21:36:55
|
Author: scottmf Date: 2009-10-22 14:36:42 -0700 (Thu, 22 Oct 2009) New Revision: 13897 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13897 Modified: trunk/src/org/hyperic/hq/measurement/server/mbean/AvailabilityCheckService.java Log: [HHQ-3498] do not allow backfiller to run unless the server is fully up. Modified: trunk/src/org/hyperic/hq/measurement/server/mbean/AvailabilityCheckService.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/mbean/AvailabilityCheckService.java 2009-10-22 21:33:14 UTC (rev 13896) +++ trunk/src/org/hyperic/hq/measurement/server/mbean/AvailabilityCheckService.java 2009-10-22 21:36:42 UTC (rev 13897) @@ -50,6 +50,7 @@ import org.hyperic.hq.measurement.shared.AvailabilityManagerLocal; import org.hyperic.hq.product.MetricValue; import org.hyperic.util.TimeUtil; +import org.hyperic.util.notReady.NotReadyManager; /** * This job is responsible for filling in missing availabilty metric values. @@ -77,6 +78,10 @@ * @jmx:managed-operation */ public void hitWithDate(Date lDate) { + if (!new NotReadyManager().isReady()) { + _log.info("availability check service not starting until server is ready."); + return; + } super.hit(lDate); } |
From: <bo...@hy...> - 2009-10-22 21:33:30
|
Author: bob Date: 2009-10-22 14:33:14 -0700 (Thu, 22 Oct 2009) New Revision: 13896 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13896 Modified: trunk/etc/version.properties Log: Release 4.2.0 build #1253 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2009-10-22 21:05:59 UTC (rev 13895) +++ trunk/etc/version.properties 2009-10-22 21:33:14 UTC (rev 13896) @@ -1,3 +1,3 @@ -#Thu Oct 22 01:11:00 PDT 2009 +#Thu Oct 22 13:52:17 PDT 2009 version=4.2.0 -build=1252 +build=1253 |
From: <kp...@hy...> - 2009-10-22 21:06:09
|
Author: kparikh Date: 2009-10-22 14:05:59 -0700 (Thu, 22 Oct 2009) New Revision: 13895 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13895 Modified: trunk/.classpath trunk/bin/exportTable.sh trunk/bin/jdbc-shell.bat trunk/plugins/alfresco/etc/hq-plugin.xml Log: [HHQ-3484] Updated mysql driver path to use new driver 5.1.10 Modified: trunk/.classpath =================================================================== --- trunk/.classpath 2009-10-22 17:48:08 UTC (rev 13894) +++ trunk/.classpath 2009-10-22 21:05:59 UTC (rev 13895) @@ -127,6 +127,7 @@ <classpathentry kind="lib" path="thirdparty/lib/mx4j/mx4j-rjmx.jar"/> <classpathentry kind="lib" path="thirdparty/lib/mx4j/mx4j-tools.jar"/> <classpathentry kind="lib" path="thirdparty/lib/mx4j/mx4j.jar"/> + <classpathentry kind="lib" path="thirdparty/lib/mysql_jdbc/mysql-connector-java-5.1.10-bin.jar"/> <classpathentry kind="lib" path="thirdparty/lib/oracle_jdbc/ojdbc14.jar"/> <classpathentry kind="lib" path="thirdparty/lib/oracle_jdbc/oracle12.jar"/> <classpathentry kind="lib" path="thirdparty/lib/postgresql/postgresql-7.4.3.jar"/> Modified: trunk/bin/exportTable.sh =================================================================== --- trunk/bin/exportTable.sh 2009-10-22 17:48:08 UTC (rev 13894) +++ trunk/bin/exportTable.sh 2009-10-22 21:05:59 UTC (rev 13895) @@ -79,7 +79,7 @@ DBUNIT_PKGS="${LIB}/dbunit-2.2.jar" PG_PKGS=${LIB}/oracle_jdbc/oracle12.jar ORA_PKGS=${LIB}/postgresql/postgresql-8.2-505.jdbc3.jar -MYSQL_PKGS=${LIB}/mysql_jdbc/mysql-connector-java-5.0.5-bin.jar +MYSQL_PKGS=${LIB}/mysql_jdbc/mysql-connector-java-5.1.10-bin.jar DB_PKGS="${PG_PKGS}:${ORA_PKGS}:${MYSQL_PKGS}" PKGS="${DB_PKGS}:${DBUNIT_PKGS}:$basedir/../build/hq.ear/hq.jar" ARGS="-Djdbc.drivers=${DRIVER} -cp ${PKGS}" Modified: trunk/bin/jdbc-shell.bat =================================================================== --- trunk/bin/jdbc-shell.bat 2009-10-22 17:48:08 UTC (rev 13894) +++ trunk/bin/jdbc-shell.bat 2009-10-22 21:05:59 UTC (rev 13895) @@ -20,7 +20,7 @@ set JDBC_CLASSPATH=%JDBC_LIB%\henplus.jar set JDBC_CLASSPATH=%JDBC_CLASSPATH%;%JDBC_LIB%\libreadline-java.jar set JDBC_CLASSPATH=%JDBC_CLASSPATH%;%JDBC_LIB%\postgresql\postgresql-7.4.3.jar -set JDBC_CLASSPATH=%JDBC_CLASSPATH%;%JDBC_LIB%\mysql_jdbc\mysql-connector-java-5.0.5-bin.jar +set JDBC_CLASSPATH=%JDBC_CLASSPATH%;%JDBC_LIB%\mysql_jdbc\mysql-connector-java-5.1.10-bin.jar for %%f in (%ORACLE_LIB%\*.jar) do set JDBC_CLASSPATH=!JDBC_CLASSPATH!;%ORACLE_LIB%\%%~nf.jar Modified: trunk/plugins/alfresco/etc/hq-plugin.xml =================================================================== --- trunk/plugins/alfresco/etc/hq-plugin.xml 2009-10-22 17:48:08 UTC (rev 13894) +++ trunk/plugins/alfresco/etc/hq-plugin.xml 2009-10-22 21:05:59 UTC (rev 13895) @@ -34,7 +34,7 @@ <classpath> <include name="pdk/lib/jdbc/jconn3.jar"/> <include name="pdk/lib/jdbc/oracle12.jar"/> - <include name="pdk/lib/jdbc/mysql-connector-java-5.0.5-bin.jar"/> + <include name="pdk/lib/jdbc/mysql-connector-java-5.1.10-bin.jar"/> </classpath> <!-- appended to each template by MeasurementInfoXML --> |
From: <no...@gi...> - 2009-10-22 18:58:48
|
Branch: refs/heads/springy Home: http://github.com/hyperic/hqapi Commit: c8981b10ce77e7091a0968f780ea2757644bc0dd http://github.com/hyperic/hqapi/commit/c8981b10ce77e7091a0968f780ea2757644bc0dd Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-19 (Mon, 19 Oct 2009) Changed paths: M .classpath Log Message: ----------- Added Spring dependencies to classpath Commit: fd9640552887bbde5878893a88ce02cbf42f269f http://github.com/hyperic/hqapi/commit/fd9640552887bbde5878893a88ce02cbf42f269f Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-22 (Thu, 22 Oct 2009) Changed paths: M .classpath Log Message: ----------- Added export of transitive dependencies to Eclipse classpath Commit: ef7b1fe3ba23ccc43d4dda7a3eaeedf90caa0631 http://github.com/hyperic/hqapi/commit/ef7b1fe3ba23ccc43d4dda7a3eaeedf90caa0631 Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-22 (Thu, 22 Oct 2009) Changed paths: M src/org/hyperic/hq/hqapi1/Connection.java M src/org/hyperic/hq/hqapi1/HQConnection.java Log Message: ----------- Added get/post methods used for multipart file push and read Commit: 78329f8d57d8b23adc80dcde9c58e888a34a2ab8 http://github.com/hyperic/hqapi/commit/78329f8d57d8b23adc80dcde9c58e888a34a2ab8 Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-22 (Thu, 22 Oct 2009) Changed paths: M src/org/hyperic/hq/hqapi1/XmlUtil.java Log Message: ----------- Modified parser to select JAXBContext based on package (for extension) Commit: b15e09e0cc81dfd2e364087321ce248a40b62d9d http://github.com/hyperic/hqapi/commit/b15e09e0cc81dfd2e364087321ce248a40b62d9d Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-22 (Thu, 22 Oct 2009) Changed paths: M src/org/hyperic/hq/hqapi1/tools/OptionParserFactory.java Log Message: ----------- Made Help option publicly accessible Commit: 5b290f57d9134309c6877c2ad8bde8fa1f37b3b9 http://github.com/hyperic/hqapi/commit/5b290f57d9134309c6877c2ad8bde8fa1f37b3b9 Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-22 (Thu, 22 Oct 2009) Changed paths: A resources/log4j.properties Log Message: ----------- Added log4j config Commit: b92e7b220176fb66fd767c8b6afe467d3c20d296 http://github.com/hyperic/hqapi/commit/b92e7b220176fb66fd767c8b6afe467d3c20d296 Author: Jennifer Hickey <jhickey@calculon.local> Date: 2009-10-22 (Thu, 22 Oct 2009) Changed paths: M .gitignore Log Message: ----------- Added ignore of logs dir created by running hqapi |
Author: scottmf Date: 2009-10-22 10:48:08 -0700 (Thu, 22 Oct 2009) New Revision: 13894 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=13894 Added: trunk/src/org/hyperic/hq/events/server/session/RegisteredTriggerStartupListener.java Modified: trunk/etc/startup_classes.txt trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java trunk/src/org/hyperic/hq/ha/server/mbean/HAService.java trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java Log: [HHQ-3475] added initializeTriggers to the startup routines, reworked the logic in EventLogDAO.getUnfixedAlertFiredEventLogs() so that it can handle multiple unfixed alerts per alertDef Modified: trunk/etc/startup_classes.txt =================================================================== --- trunk/etc/startup_classes.txt 2009-10-22 17:30:23 UTC (rev 13893) +++ trunk/etc/startup_classes.txt 2009-10-22 17:48:08 UTC (rev 13894) @@ -1,4 +1,5 @@ org.hyperic.hq.product.server.session.ProductStartupListener +org.hyperic.hq.events.server.session.RegisteredTriggerStartupListener org.hyperic.hq.authz.server.session.GroupingStartupListener org.hyperic.hq.authz.server.session.AuthzStartupListener org.hyperic.hq.common.server.session.CommonStartupListener @@ -14,4 +15,4 @@ org.hyperic.hq.bizapp.server.session.BossStartupListener org.hyperic.hq.ha.server.session.HAStartupListener org.hyperic.hq.events.server.session.HeartBeatServiceStartupListener -org.hyperic.hq.events.server.session.HQDBHealthStartupListener \ No newline at end of file +org.hyperic.hq.events.server.session.HQDBHealthStartupListener Modified: trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java =================================================================== --- trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java 2009-10-22 17:30:23 UTC (rev 13893) +++ trunk/src/org/hyperic/hq/events/ext/RegisteredTriggers.java 2009-10-22 17:48:08 UTC (rev 13894) @@ -1,18 +1,26 @@ /* - * NOTE: This copyright doesnot cover user programs that use HQ program services - * by normal system calls through the application program interfaces provided as - * part of the Hyperic Plug-in Development Kit or the Hyperic Client Development - * Kit - this is merely considered normal use of the program, and doesnot fall - * under the heading of "derived work". Copyright (C) [2004, 2005, 2006], - * Hyperic, Inc. This file is part of HQ. HQ is free software; you can - * redistribute it and/or modify it under the terms version 2 of the GNU General - * Public License as published by the Free Software Foundation. This program is - * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more details. You - * should have received a copy of the GNU General Public License along with this - * program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA. + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004-2009], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. */ /* @@ -27,14 +35,14 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hyperic.hq.events.AbstractEvent; import org.hyperic.hq.events.server.session.AlertRegulator; import org.hyperic.hq.events.server.session.RegisteredTriggerManagerEJBImpl; -import org.hyperic.hq.events.shared.RegisteredTriggerManagerLocal; - - /** * Repository of in memory triggers for event processing * @author jhickey @@ -46,13 +54,16 @@ private static final Object INIT_LOCK = new Object(); - private static RegisteredTriggers INSTANCE; + private static RegisteredTriggers INSTANCE = new RegisteredTriggers(); - private boolean initialized = false; + // use AtomicBoolean so that simple ops like reset() don't hang + private final AtomicBoolean initialized = new AtomicBoolean(false); private Object triggerUpdateLock = new Object(); private Map triggers = new ConcurrentHashMap(); + + private static final Log log = LogFactory.getLog(RegisteredTriggers.class); RegisteredTriggers() { @@ -62,18 +73,22 @@ return this.triggers; } - void init() { + private void init() { synchronized (INIT_LOCK) { this.triggers = new ConcurrentHashMap(); RegisteredTriggerManagerEJBImpl.getOne().initializeTriggers(); - initialized = true; + initialized.set(true); } } void setInitialized(boolean initialized) { - synchronized (INIT_LOCK) { - this.initialized = initialized; + if (!initialized) { + log.info("Resetting Triggers"); + if (log.isDebugEnabled()) { + log.debug("Stack Trace For Trigger Reset", new Throwable()); + } } + this.initialized.set(initialized); } public Collection getInterestedTriggers(Class eventClass, Integer instanceId) { @@ -172,34 +187,31 @@ } public boolean isInitialized() { + return initialized.get(); + } + + /** + * Will block if the Triggers are not initialized. + */ + public static RegisteredTriggers getAndInitialize() { + RegisteredTriggers instance = getInstance(); + if (instance.isInitialized()) { + return instance; + } synchronized (INIT_LOCK) { - return initialized; + if (!instance.isInitialized()) { + instance.init(); + } } + return instance; } - - private static RegisteredTriggers getAndInitialize() { - synchronized (INIT_LOCK) { - RegisteredTriggers instance = getInstance(); - if(!instance.isInitialized()) { - instance.init(); - } - return instance; - } - } public static RegisteredTriggers getInstance() { - synchronized (INIT_LOCK) { - if (INSTANCE == null) { - INSTANCE = new RegisteredTriggers(); - } - } return INSTANCE; } public static void reset() { - synchronized (INIT_LOCK) { - getInstance().setInitialized(false); - } + getInstance().setInitialized(false); } public static Collection getInterestedTriggers(AbstractEvent event) { Modified: trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-10-22 17:30:23 UTC (rev 13893) +++ trunk/src/org/hyperic/hq/events/server/session/EventLogDAO.java 2009-10-22 17:48:08 UTC (rev 13894) @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -217,6 +218,9 @@ return res; } + /** + * @return 0 if there are no unfixed alerts + */ private final long getOldestUnfixedAlertTime() { Object o = getSession() .createQuery("select min(ctime) from Alert where fixed = '0'") @@ -229,14 +233,15 @@ /** * @return {@link Map} of {@link Integer} = AlertDefitionId to - * {@link Object[]} <br> - * [0] {@link Integer} AlertDefId, <br> - * [1] {@link Integer} AlertId + * {@link Map} of <br> + * key {@link AlertInfo} <br> + * value {@link Integer} AlertId */ private final Map getUnfixedAlertInfoAfter(long ctime) { final String hql = new StringBuilder(128) - .append("SELECT alertDefinition.id, id ") - .append("FROM Alert WHERE ctime >= :ctime and fixed = '0'") + .append("SELECT alertDefinition.id, id, ctime ") + .append("FROM Alert WHERE ctime >= :ctime and fixed = '0' ") + .append("ORDER BY ctime") .toString(); final List list = getSession() .createQuery(hql) @@ -245,11 +250,50 @@ final Map alerts = new HashMap(list.size()); for (final Iterator it=list.iterator(); it.hasNext(); ) { final Object[] obj = (Object[]) it.next(); - alerts.put(obj[0], obj); + Map tmp; + if (null == (tmp = (Map)alerts.get(obj[0]))) { + tmp = new HashMap(); + alerts.put(obj[0], tmp); + } + final AlertInfo ai = new AlertInfo((Integer)obj[0], (Long)obj[2]); + tmp.put(ai, (Integer)obj[1]); } return alerts; } + private class AlertInfo { + private final Integer _alertDefId; + private final Long _ctime; + AlertInfo(Integer alertDefId, Long ctime) { + _alertDefId = alertDefId; + _ctime = ctime; + } + AlertInfo(Integer alertDefId, long ctime) { + _alertDefId = alertDefId; + _ctime = new Long(ctime); + } + Integer getAlertDefId() { + return _alertDefId; + } + Long getCtime() { + return _ctime; + } + public boolean equals(Object rhs) { + if (rhs == this) { + return true; + } + if (rhs instanceof AlertInfo) { + AlertInfo obj = (AlertInfo)rhs; + return obj.getCtime().equals(_ctime) && + obj.getAlertDefId().equals(_alertDefId); + } + return false; + } + public int hashCode() { + return 17*_alertDefId.hashCode() + _ctime.hashCode(); + } + } + /** * Find unfixed AlertFiredEvent event logs for each alert definition in the list * @@ -261,6 +305,9 @@ Map findUnfixedAlertFiredEventLogs() { final Map rtn = new HashMap(); final long ctime = getOldestUnfixedAlertTime(); + if (ctime == 0) { + return Collections.EMPTY_MAP; + } final Map alerts = getUnfixedAlertInfoAfter(ctime); final String hql = new StringBuilder(256) .append("FROM EventLog ") @@ -277,25 +324,20 @@ if (log == null || log.getInstanceId() == null) { continue; } - final Object[] obj = (Object[])alerts.get(log.getInstanceId()); - if (obj == null) { + final Map objs = (Map)alerts.get(log.getInstanceId()); + if (objs == null) { continue; } - final Integer alertDefId = (Integer)obj[0]; - final Integer alertId = (Integer)obj[1]; - AlertFiredEvent latestEvent; - boolean updateMap = false; - if (null != (latestEvent = (AlertFiredEvent)rtn.get(alertDefId)) && - log.getTimestamp() > latestEvent.getTimestamp()) { - updateMap = true; - } else { - updateMap = true; + final Integer alertDefId = log.getInstanceId(); + final long timestamp = log.getTimestamp(); + final Integer alertId = + (Integer)objs.get(new AlertInfo(alertDefId, timestamp)); + if (alertId == null) { + continue; } - if (updateMap) { - AlertFiredEvent alertFired = - createAlertFiredEvent(alertDefId, alertId, log); - rtn.put(alertDefId, alertFired); - } + AlertFiredEvent alertFired = + createAlertFiredEvent(alertDefId, alertId, log); + rtn.put(alertDefId, alertFired); } return rtn; } Added: trunk/src/org/hyperic/hq/events/server/session/RegisteredTriggerStartupListener.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/RegisteredTriggerStartupListener.java (rev 0) +++ trunk/src/org/hyperic/hq/events/server/session/RegisteredTriggerStartupListener.java 2009-10-22 17:48:08 UTC (rev 13894) @@ -0,0 +1,71 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004-2009], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.events.server.session; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hyperic.hq.application.StartupListener; +import org.hyperic.hq.events.ext.RegisteredTriggers; +import org.hyperic.hq.hibernate.SessionManager; +import org.hyperic.hq.hibernate.SessionManager.SessionRunner; + +public class RegisteredTriggerStartupListener implements StartupListener { + + private static final Log _log = + LogFactory.getLog(RegisteredTriggerStartupListener.class); + private static Thread initTriggerRunner; + + public void hqStarted() { + final SessionRunner runner = new SessionRunner() { + public String getName() { + return "TriggersInitializationStartup"; + } + public void run() throws Exception { + RegisteredTriggers.getAndInitialize(); + } + }; + initTriggerRunner = new Thread("Trigger Init") { + public void run() { + try { + final long start = System.currentTimeMillis(); + _log.info("Starting Trigger Initialization"); + SessionManager.runInSession(runner); + final long end = System.currentTimeMillis(); + _log.info("Finished Trigger Initialization, took " + + (end-start)/1000 + " seconds"); + } catch (Exception e) { + _log.error(e, e); + } + } + }; + initTriggerRunner.start(); + } + + public static Thread getRunnerThread() { + return initTriggerRunner; + } + +} Modified: trunk/src/org/hyperic/hq/ha/server/mbean/HAService.java =================================================================== --- trunk/src/org/hyperic/hq/ha/server/mbean/HAService.java 2009-10-22 17:30:23 UTC (rev 13893) +++ trunk/src/org/hyperic/hq/ha/server/mbean/HAService.java 2009-10-22 17:48:08 UTC (rev 13894) @@ -42,6 +42,7 @@ implements HAServiceMBean { private static Log _log = LogFactory.getLog(HAService.class); + private static boolean isFirstPass = true; /** * @jmx:managed-operation @@ -50,7 +51,13 @@ MBeanServer server = MBeanUtil.getMBeanServer(); //Reset in-memory triggers - RegisteredTriggers.reset(); + if (!isFirstPass) { + // RegisteredTriggers already does a startup initialization + // don't want to reset that. + RegisteredTriggers.reset(); + } else { + isFirstPass = false; + } _log.info("Starting HA Services"); Modified: trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java =================================================================== --- trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java 2009-10-22 17:30:23 UTC (rev 13893) +++ trunk/src/org/hyperic/hq/product/server/mbean/ProductPluginDeployer.java 2009-10-22 17:48:08 UTC (rev 13894) @@ -62,6 +62,7 @@ import org.hyperic.hq.application.HQApp; import org.hyperic.hq.bizapp.server.session.SystemAudit; import org.hyperic.hq.common.SystemException; +import org.hyperic.hq.events.server.session.RegisteredTriggerStartupListener; import org.hyperic.hq.hqu.rendit.RenditServer; import org.hyperic.hq.product.PluginException; import org.hyperic.hq.product.PluginInfo; @@ -226,6 +227,7 @@ .getPluginsDeployedCaller().pluginsDeployed(_plugins); _plugins.clear(); + waitForTriggerInit(); startConcurrentStatsCollector(); //generally means we are done deploying plugins at startup. @@ -244,6 +246,17 @@ } } + private void waitForTriggerInit() { + Thread thread = RegisteredTriggerStartupListener.getRunnerThread(); + while (thread.isAlive()) { + _log.info("waiting for Trigger Initialization to complete"); + try { + thread.join(10000); + } catch (InterruptedException e) { + } + } + } + private void startConcurrentStatsCollector() { String prop = System.getProperty("hq.unittest.run"); System.out.println(prop); |