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...> - 2010-03-01 09:21:08
|
Author: bob Date: 2010-03-01 01:20:57 -0800 (Mon, 01 Mar 2010) New Revision: 14334 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14334 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1364 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-02-28 09:17:14 UTC (rev 14333) +++ trunk/etc/version.properties 2010-03-01 09:20:57 UTC (rev 14334) @@ -1,4 +1,4 @@ -#Sun, 28 Feb 2010 00:32:30 -0800 +#Mon, 01 Mar 2010 00:33:54 -0800 #Fri Feb 26 00:34:19 PST 2010 version=4.3.0 -build=1363 +build=1364 |
From: <bo...@hy...> - 2010-02-28 09:17:23
|
Author: bob Date: 2010-02-28 01:17:14 -0800 (Sun, 28 Feb 2010) New Revision: 14333 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14333 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1363 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-02-27 09:08:07 UTC (rev 14332) +++ trunk/etc/version.properties 2010-02-28 09:17:14 UTC (rev 14333) @@ -1,4 +1,4 @@ -#Sat, 27 Feb 2010 00:29:29 -0800 +#Sun, 28 Feb 2010 00:32:30 -0800 #Fri Feb 26 00:34:19 PST 2010 version=4.3.0 -build=1362 +build=1363 |
From: David <sig...@hy...> - 2010-02-28 00:51:02
|
There are 5 java processes running on a Solaris 10 box that I have to monitor in Hyperic. The problem is that when doing a ps the command line gets cut off at 80 characters and the first 80 characters are all the same. When looking at the processes within sigar I see the same problem. IE sigar> pargs 2967 pid=2967 exe= cwd= 0=>/usr/jdk/instances/jdk1.5.0/bin/sparcv9/java<= 1=>-Xms3500M<= 2=>-Xmx3500M<= 3=>-classpath<= 4=>/op<= At the moment we cannot change the way these get run becasue they belong to someone else and we cannot get them changed. My job is just to monitor them in hyperic, long term we might be able to get them changed but for now we need to be able to distinguish these 5 processes yet they all say the same thing is sigar becasue the rest of the command line arguments are missing. Any Ideas? |
From: <bo...@hy...> - 2010-02-27 09:08:15
|
Author: bob Date: 2010-02-27 01:08:07 -0800 (Sat, 27 Feb 2010) New Revision: 14332 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14332 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1362 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-02-27 01:34:00 UTC (rev 14331) +++ trunk/etc/version.properties 2010-02-27 09:08:07 UTC (rev 14332) @@ -1,3 +1,4 @@ +#Sat, 27 Feb 2010 00:29:29 -0800 #Fri Feb 26 00:34:19 PST 2010 version=4.3.0 -build=1361 +build=1362 |
From: <sc...@hy...> - 2010-02-27 02:37:07
|
Author: scottmf Date: 2010-02-26 17:34:00 -0800 (Fri, 26 Feb 2010) New Revision: 14331 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14331 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java trunk/src/org/hyperic/hq/events/server/session/ActionDAO.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java Log: [HHQ-3534] separate cleanupAlertDefs action into different hibernate sessions and prefetched all related pojos to ehcache before delete starts. Modified: trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2010-02-27 00:51:11 UTC (rev 14330) +++ trunk/src/org/hyperic/hq/bizapp/server/session/EventsBossEJBImpl.java 2010-02-27 01:34:00 UTC (rev 14331) @@ -49,7 +49,6 @@ import org.hyperic.hibernate.PageInfo; import org.hyperic.hq.appdef.server.session.AppdefResourceType; import org.hyperic.hq.appdef.server.session.ResourceDeletedZevent; -import org.hyperic.hq.appdef.server.session.ResourceZevent; import org.hyperic.hq.appdef.shared.AppdefEntityConstants; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.appdef.shared.AppdefEntityNotFoundException; @@ -73,7 +72,6 @@ import org.hyperic.hq.authz.shared.PermissionException; import org.hyperic.hq.authz.shared.PermissionManagerFactory; import org.hyperic.hq.authz.shared.ResourceGroupManagerLocal; -import org.hyperic.hq.bizapp.server.trigger.conditional.ConditionalTriggerInterface; import org.hyperic.hq.bizapp.shared.EventsBossLocal; import org.hyperic.hq.bizapp.shared.EventsBossUtil; import org.hyperic.hq.common.ApplicationException; @@ -109,7 +107,6 @@ import org.hyperic.hq.events.server.session.AlertManagerEJBImpl; import org.hyperic.hq.events.server.session.AlertSortField; import org.hyperic.hq.events.server.session.ClassicEscalationAlertType; -import org.hyperic.hq.events.server.session.EventsStartupListener; import org.hyperic.hq.events.server.session.RegisteredTriggerManagerEJBImpl; import org.hyperic.hq.events.server.session.TriggersCreatedZevent; import org.hyperic.hq.events.shared.ActionManagerLocal; @@ -120,7 +117,6 @@ import org.hyperic.hq.events.shared.AlertManagerLocal; import org.hyperic.hq.events.shared.MaintenanceEventManagerInterface; import org.hyperic.hq.events.shared.RegisteredTriggerManagerLocal; -import org.hyperic.hq.events.shared.RegisteredTriggerValue; import org.hyperic.hq.galerts.server.session.GalertDef; import org.hyperic.hq.galerts.server.session.GalertEscalationAlertType; import org.hyperic.hq.galerts.server.session.GalertLogSortField; @@ -1835,27 +1831,41 @@ inst.addBufferedListener( events, new ZeventListener() { public void processEvents(List events) { - final StopWatch watch = new StopWatch(); - final Log log = LogFactory.getLog(this.getClass().getName()); - final boolean debug = log.isDebugEnabled(); - final AlertDefinitionManagerLocal adm = getADM(); + final int batchSize = 500; final List alertDefs = getADM().getAllDeletedAlertDefs(); - final int batchSize = 500; - for (int i=0; i<alertDefs.size(); i+=batchSize) { - final int end = Math.min(i+batchSize, alertDefs.size()); - final List sublist = alertDefs.subList(i, end); - // can't pass in pojos since the session changes - final List ids = new ArrayList(sublist.size()); - for (final Iterator it=sublist.iterator(); it.hasNext(); ) { - final AlertDefinition def = (AlertDefinition) it.next(); - ids.add(def.getId()); + try { + final int size = alertDefs.size(); + for (int ii=0; ii<size; ii+=batchSize) { + final int end = Math.min(size, ii+batchSize); + final List list = alertDefs.subList(ii, end); + org.hyperic.hq.hibernate.SessionManager.runInSession( + new org.hyperic.hq.hibernate.SessionManager.SessionRunner() { + public void run() { + deleteAlertDefs(list); + } + public String getName() { + return "CleanupAlertDefRunner"; + } + } + ); } - if (debug) watch.markTimeBegin("cleanupAlertDefs"); - adm.cleanupAlertDefs(ids); - if (debug) watch.markTimeEnd("cleanupAlertDefs"); + } catch (Exception e) { + _log.error(e,e); } - if (debug) log.debug(watch); } + + private void deleteAlertDefs(List defIds) { + final StopWatch watch = new StopWatch(); + final boolean debug = _log.isDebugEnabled(); + final AlertDefinitionManagerLocal adm = getADM(); + if (defIds.size() == 0) { + return; + } + if (debug) watch.markTimeBegin("cleanupAlertDefs"); + adm.cleanupAlertDefs(defIds); + if (debug) watch.markTimeEnd("cleanupAlertDefs"); + if (debug) _log.debug(watch); + } public String toString() { return "AlertDefCleanupListener"; Modified: trunk/src/org/hyperic/hq/events/server/session/ActionDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/ActionDAO.java 2010-02-27 00:51:11 UTC (rev 14330) +++ trunk/src/org/hyperic/hq/events/server/session/ActionDAO.java 2010-02-27 01:34:00 UTC (rev 14331) @@ -25,8 +25,11 @@ package org.hyperic.hq.events.server.session; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import org.hibernate.Query; import org.hibernate.criterion.Restrictions; @@ -54,18 +57,26 @@ super.remove(entity); } - private void removeActionCascade(Action action) { - if (action.getParent() != null) { - action.getParent().getChildrenBag().remove(action); - } - remove(action); - } - void removeActions(AlertDefinition def) { + Map parentToActions = new HashMap(); for (Iterator it = def.getActions().iterator(); it.hasNext(); ) { Action action = (Action) it.next(); - removeActionCascade(action); + List list; + if (null == (list = (List)parentToActions.get(action.getParent()))) { + list = new ArrayList(); + parentToActions.put(action.getParent(), list); + } + list.add(action); } + for (Iterator it = parentToActions.entrySet().iterator(); it.hasNext(); ) { + Map.Entry entry = (Entry) it.next(); + Action parent = (Action) entry.getKey(); + if (parent == null) { + continue; + } + List actions = (List) entry.getValue(); + parent.getChildrenBag().removeAll(actions); + } def.clearActions(); } @@ -73,7 +84,10 @@ if (action.getAlertDefinition() != null) { action.getAlertDefinition().getActionsBag().remove(action); } - removeActionCascade(action); + if (action.getParent() != null) { + action.getParent().getChildrenBag().remove(action); + } + remove(action); } void deleteAlertDefinition(AlertDefinition def) { Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java 2010-02-27 00:51:11 UTC (rev 14330) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionDAO.java 2010-02-27 01:34:00 UTC (rev 14331) @@ -73,11 +73,43 @@ return createCriteria().add(Restrictions.eq("resource", r)).list(); } - public List findAllDeletedResources() { - return createCriteria() - .add(Restrictions.isNull("resource")) - .add(Restrictions.eq("deleted", Boolean.TRUE)) - .list(); + /** + * Prefetches all collections associated with each alertDef that is deleted and has a + * null resourceId into ehcache. + * @return {@link List} of {@link Integer} of {@link AlertDefintion} ids + */ + public List findAndPrefetchAllDeletedAlertDefs() { + // need to pre-fetch one bag at a time due to bug + // http://opensource.atlassian.com/projects/hibernate/browse/HHH-2980 + String hql = new StringBuilder() + .append("from AlertDefinition def ") + .append("left outer join fetch def.childrenBag cb ") + .append("where def.resource is null and def.deleted = '1'") + .toString(); + getSession().createQuery(hql).list(); + hql = new StringBuilder() + .append("from AlertDefinition def ") + .append("left outer join fetch def.actionsBag ab ") + .append("where def.resource is null and def.deleted = '1'") + .toString(); + getSession().createQuery(hql).list(); + hql = new StringBuilder() + .append("from AlertDefinition def ") + .append("left outer join fetch def.conditionsBag condb ") + .append("where def.resource is null and def.deleted = '1'") + .toString(); + getSession().createQuery(hql).list(); + hql = new StringBuilder() + .append("from AlertDefinition def ") + .append("left outer join fetch def.triggersBag tb ") + .append("where def.resource is null and def.deleted = '1'") + .toString(); + getSession().createQuery(hql).list(); + hql = new StringBuilder() + .append("select def.id from AlertDefinition def ") + .append("where def.resource is null and def.deleted = '1'") + .toString(); + return getSession().createQuery(hql).list(); } /** Modified: trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2010-02-27 00:51:11 UTC (rev 14330) +++ trunk/src/org/hyperic/hq/events/server/session/AlertDefinitionManagerEJBImpl.java 2010-02-27 01:34:00 UTC (rev 14331) @@ -792,10 +792,13 @@ } /** + * Prefetches all collections associated with each alertDef that is deleted and has a + * null resourceId into ehcache. + * @return {@link List} of {@link Integer} of {@link AlertDefintion} ids * @ejb:interface-method */ public List getAllDeletedAlertDefs() { - return getAlertDefDAO().findAllDeletedResources(); + return getAlertDefDAO().findAndPrefetchAllDeletedAlertDefs(); } /** @@ -811,11 +814,14 @@ final AlertDAO dao = getAlertDAO(); final AlertDefinitionDAO aDao = getAlertDefDAO(); final ActionDAO actionDAO = getActionDAO(); + int i=0; try { final List alertDefs = new ArrayList(alertDefIds.size()); - for (final Iterator i = alertDefIds.iterator(); i.hasNext();) { - final Integer alertdefId = (Integer) i.next(); + for (final Iterator it = alertDefIds.iterator(); it.hasNext();) { + final Integer alertdefId = (Integer) it.next(); + if (debug) watch.markTimeBegin("findById"); final AlertDefinition alertdef = aDao.findById(alertdefId); + if (debug) watch.markTimeEnd("findById"); alertDefs.add(alertdef); } // Delete the alerts @@ -823,8 +829,9 @@ dao.deleteByAlertDefinitions(alertDefs); if (debug) watch.markTimeEnd("deleteByAlertDefinition"); - for (final Iterator i = alertDefs.iterator(); i.hasNext();) { - final AlertDefinition alertdef = (AlertDefinition) i.next(); + if (debug) watch.markTimeBegin("loop"); + for (final Iterator it = alertDefs.iterator(); it.hasNext();) { + final AlertDefinition alertdef = (AlertDefinition) it.next(); // Remove the conditions if (debug) watch.markTimeBegin("remove conditions and triggers"); @@ -847,10 +854,12 @@ if (debug) watch.markTimeBegin("remove"); aDao.remove(alertdef); if (debug) watch.markTimeEnd("remove"); + i++; } + if (debug) watch.markTimeEnd("loop"); } finally { - if (debug) log.debug("deleted " + alertDefIds.size() + " alertDefs: " + watch); + if (debug) log.debug("deleted " + i + " alertDefs: " + watch); } } |
From: <no...@gi...> - 2010-02-27 02:31:17
|
Branch: refs/heads/evolution Home: http://github.com/hyperic/hqapi Commit: f9e96b3fcaa8c5a7ff7eea4fda1bbe8c1fe6247c http://github.com/hyperic/hqapi/commit/f9e96b3fcaa8c5a7ff7eea4fda1bbe8c1fe6247c Author: Jennifer Hickey <jen...@sp...> Date: 2010-02-26 (Fri, 26 Feb 2010) Changed paths: M hqu/hqapi1/app/MetricdataController.groovy Log Message: ----------- Removed StartupListener and all impls Commit: 5479e69c7a4c0970ec6520fd3f5844a6bf13349f http://github.com/hyperic/hqapi/commit/5479e69c7a4c0970ec6520fd3f5844a6bf13349f Author: Jennifer Hickey <jen...@sp...> Date: 2010-02-26 (Fri, 26 Feb 2010) Changed paths: M build.xml M hqu/hqapi1/app/AlertdefinitionController.groovy 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 M src/org/hyperic/hq/hqapi1/test/AlertDefinitionTestBase.java M xsd/HQApi1.xsd Log Message: ----------- Merge branch 'evolution' of github.com:hyperic/hqapi into evolution |
From: <sc...@hy...> - 2010-02-27 00:57:22
|
Author: scottmf Date: 2010-02-26 16:37:42 -0800 (Fri, 26 Feb 2010) New Revision: 14328 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14328 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java trunk/src/org/hyperic/hq/measurement/server/session/MeasurementManagerEJBImpl.java Log: [HHQ-3759] added extra checking around async delete Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2010-02-27 00:27:00 UTC (rev 14327) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MetricSessionEJB.java 2010-02-27 00:37:42 UTC (rev 14328) @@ -615,6 +615,9 @@ } if (debug) watch.markTimeBegin("findResource size=" + size); final Resource res = rMan.findResource(id); + if (res == null || res.isInAsyncDeleteState()) { + continue; + } if (debug) watch.markTimeEnd("findResource size=" + size); List list; if (null != measCache Modified: trunk/src/org/hyperic/hq/measurement/server/session/MeasurementManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/MeasurementManagerEJBImpl.java 2010-02-27 00:27:00 UTC (rev 14327) +++ trunk/src/org/hyperic/hq/measurement/server/session/MeasurementManagerEJBImpl.java 2010-02-27 00:37:42 UTC (rev 14328) @@ -43,6 +43,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.hibernate.ObjectNotFoundException; import org.hyperic.hq.appdef.Agent; import org.hyperic.hq.appdef.AppService; import org.hyperic.hq.appdef.server.session.AgentManagerEJBImpl; @@ -809,7 +810,11 @@ } else { resource = resMan.findResourceById((Integer) o); } - if (resource == null || resource.isInAsyncDeleteState()) { + try { + if (resource == null || resource.isInAsyncDeleteState()) { + continue; + } + } catch (ObjectNotFoundException e) { continue; } final ResourceType type = resource.getResourceType(); |
From: <sc...@hy...> - 2010-02-27 00:57:17
|
Author: scottmf Date: 2010-02-26 16:27:00 -0800 (Fri, 26 Feb 2010) New Revision: 14327 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14327 Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java trunk/src/org/hyperic/hq/escalation/server/session/EscalationStateDAO.java Log: cleaned up code a little. Added extra checks around async delete scenarios Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-26 18:12:06 UTC (rev 14326) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-27 00:27:00 UTC (rev 14327) @@ -40,6 +40,7 @@ import org.hyperic.dao.DAOFactory; import org.hyperic.hq.authz.server.session.AuthzSubject; import org.hyperic.hq.authz.server.session.AuthzSubjectManagerEJBImpl; +import org.hyperic.hq.authz.server.session.Resource; import org.hyperic.hq.authz.server.shared.ResourceDeletedException; import org.hyperic.hq.authz.shared.PermissionException; import org.hyperic.hq.common.ApplicationException; @@ -49,13 +50,10 @@ import org.hyperic.hq.escalation.EscalationEvent; import org.hyperic.hq.escalation.shared.EscalationManagerLocal; import org.hyperic.hq.escalation.shared.EscalationManagerUtil; -import org.hyperic.hq.escalation.server.session.Escalation; -import org.hyperic.hq.escalation.server.session.Escalatable; -import org.hyperic.hq.escalation.server.session.EscalationAlertType; -import org.hyperic.hq.escalation.server.session.PerformsEscalations; -import org.hyperic.hq.escalation.server.session.EscalationState; import org.hyperic.hq.events.ActionConfigInterface; import org.hyperic.hq.events.ActionExecutionInfo; +import org.hyperic.hq.events.AlertDefinitionInterface; +import org.hyperic.hq.events.AlertInterface; import org.hyperic.hq.events.EventConstants; import org.hyperic.hq.events.Notify; import org.hyperic.hq.events.server.session.Action; @@ -64,7 +62,6 @@ import org.hyperic.hq.events.server.session.AlertRegulator; import org.hyperic.hq.events.server.session.ClassicEscalationAlertType; import org.hyperic.hq.events.server.session.SessionBase; -import org.hyperic.hq.escalation.server.session.EscalatableCreator; import org.hyperic.hq.galerts.server.session.GalertEscalationAlertType; import org.hyperic.hq.galerts.server.session.GalertManagerEJBImpl; import org.hyperic.util.units.FormattedNumber; @@ -442,7 +439,7 @@ private void endEscalation(EscalationState state) { if (state != null) { // make sure we have the updated state to avoid StaleStateExceptions - state = _stateDAO.findById(state.getId()); + state = _stateDAO.getById(state.getId()); if (state == null) { return; } @@ -517,32 +514,10 @@ // HQ exception and not worry about checking for alert types explicitly // but after talking with folks about it, sounds like it would require // touching a lot more plumbing code... - EscalationAlertType alertType = s.getAlertType(); - boolean isAlertNotFound = true; - - try { - if (alertType instanceof GalertEscalationAlertType) { - isAlertNotFound = - GalertManagerEJBImpl.getOne().getAlertLog(new Integer(s.getAlertId())) == null; - } else if (alertType instanceof ClassicEscalationAlertType) { - // HHQ-3499, need to make sure that the alertId that is pointed to by - // the escalation still exists - AlertDAO dao = DAOFactory.getDAOFactory().getAlertDAO(); - - isAlertNotFound = (dao.getById(new Integer(s.getAlertId())) == null); - } - } catch(Exception ex) { - log.warn("An unexpected error has occurred while checking if alert with id[" + s.getAlertId() + " and escalation type [" + s.getAlertType().getClass().getName() + "] exists.", ex); - // ...could not determine whether or not the alert exists, so we'll assume it doesn't and - // end the escalation below... - } - - if (isAlertNotFound) { - if (debug) log.debug("Alert with id[" + s.getAlertId() + " and escalation type [" + s.getAlertType().getClass().getName() + "] was not found. Canceling escalation..."); - + if (!escIsValid(s)) { + if (debug) log.debug("alert cannot be escalated, since it is not valid."); endEscalation(s); - - return; + return; } Escalatable esc = getEscalatable(s); @@ -591,6 +566,41 @@ } } + private boolean escIsValid(EscalationState s) { + final boolean debug = log.isDebugEnabled(); + EscalationAlertType alertType = s.getAlertType(); + AlertInterface alert = null; + // HHQ-3499, need to make sure that the alertId that is pointed to by + // the escalation still exists + if (alertType instanceof GalertEscalationAlertType) { + alert = GalertManagerEJBImpl.getOne().getAlertLog(new Integer(s.getAlertId())); + } else if (alertType instanceof ClassicEscalationAlertType) { + AlertDAO dao = DAOFactory.getDAOFactory().getAlertDAO(); + alert = dao.getById(new Integer(s.getAlertId())); + } + if (alert == null) { + if (debug) log.debug("Alert with id[" + s.getAlertId() + + " and escalation type [" + s.getAlertType().getClass().getName() + + "] was not found."); + return false; + } + AlertDefinitionInterface def = alert.getAlertDefinitionInterface(); + if (def == null) { + if (debug) log.debug("AlertDef from alertid=" + s.getAlertId() + + " was not found."); + endEscalation(s); + return false; + } + Resource r = def.getResource(); + if (r == null || r.isInAsyncDeleteState()) { + if (debug) log.debug("Resource from alertid=" + s.getAlertId() + + " was not found."); + endEscalation(s); + return false; + } + return true; + } + /** * Check if the escalation state or its associated escalating entity * has been deleted. Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationStateDAO.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationStateDAO.java 2010-02-26 18:12:06 UTC (rev 14326) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationStateDAO.java 2010-02-27 00:27:00 UTC (rev 14327) @@ -41,6 +41,10 @@ super(EscalationState.class, f); } + EscalationState getById(Integer id) { + return (EscalationState)super.get(id); + } + EscalationState findById(Integer id) { return (EscalationState)super.findById(id); } |
From: <sc...@hy...> - 2010-02-27 00:51:27
|
Author: scottmf Date: 2010-02-26 16:51:11 -0800 (Fri, 26 Feb 2010) New Revision: 14330 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14330 Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java Log: [HHQ-3759] added extra checking around async delete Modified: trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2010-02-27 00:44:08 UTC (rev 14329) +++ trunk/src/org/hyperic/hq/measurement/server/session/AvailabilityManagerEJBImpl.java 2010-02-27 00:51:11 UTC (rev 14330) @@ -46,6 +46,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.hibernate.ObjectNotFoundException; import org.hyperic.hq.appdef.shared.AppdefEntityConstants; import org.hyperic.hq.appdef.shared.AppdefEntityID; import org.hyperic.hq.appdef.shared.AppdefEntityValue; @@ -586,6 +587,15 @@ resource = resMan.findResourceById((Integer) o); } List measIds = null; + try { + if (resource == null || resource.isInAsyncDeleteState()) { + continue; + } + } catch (ObjectNotFoundException e) { + // resource is in async delete state, ignore + _log.debug("resource not found from object=" + o ,e); + continue; + } if (measCache != null) { measIds = (List)measCache.get(resource.getId()); } |
From: <sc...@hy...> - 2010-02-27 00:47:47
|
Author: scottmf Date: 2010-02-26 16:44:08 -0800 (Fri, 26 Feb 2010) New Revision: 14329 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14329 Modified: trunk/src/org/hyperic/util/timer/StopWatch.java Log: modified so that if timer has not been accessed it will display marker=null instead of marker=0 Modified: trunk/src/org/hyperic/util/timer/StopWatch.java =================================================================== --- trunk/src/org/hyperic/util/timer/StopWatch.java 2010-02-27 00:37:42 UTC (rev 14328) +++ trunk/src/org/hyperic/util/timer/StopWatch.java 2010-02-27 00:44:08 UTC (rev 14329) @@ -104,13 +104,17 @@ } private void writeBuf(String marker, List tsList, StringBuffer buf) { - long total = 0l; + long total = -1; for (Iterator it=tsList.iterator();it.hasNext();) { TimeSlice ts = (TimeSlice)it.next(); - total += ts.getElapsed(); + Long elapsed = ts.getElapsed(); + if (elapsed == null) { + continue; + } + total += elapsed.longValue(); } buf.append(" [").append(marker).append("=") - .append(StringUtil.formatDuration(total, 2, true)) + .append((total < 0) ? "null" : StringUtil.formatDuration(total, 2, true)) .append("]"); } @@ -121,16 +125,19 @@ public TimeSlice (String marker) { _marker = marker; - _begin = _end=now(); + _begin = now(); + _end = 0; } public void setFinished () { _end= now(); } - public long getElapsed() { - final long end = (_end == 0) ? now() : _end; - return end - _begin; + public Long getElapsed() { + if (_end == 0) { + return null; + } + return new Long(_end - _begin); } } } |
From: Anthony S. <an...@co...> - 2010-02-26 18:17:08
|
Hi Doug, One way to look at the ControlTier framework is that we "extend Ant for use as a deployment tool" ... i.e. ControlTier is a Java framework whose systems or module language is Ant. We've traditionally stuck to application life-cycle process automation (web applications based on Apache HTTP, Tomcat, JBoss and a host of other platforms), as opposed to system provisioning (like Puppet or Chef, etc), but you're probably aware that there is a degree of overlap between these domains of activity. It's here that I'm interested in Sigar Ant tasks. It would be really sweet to use your library to gain access to system state values of one sort or another ... a bit like Puppet's "Facter" facility if you're familiar with that. Even at the simplest level such data would be really useful. For example, we could include checks in our implementations to ensure sufficient disk space is available ahead of installing a software package, etc. We do have bindings to all sorts of other scripting languages (notably Groovy) so we can leverage library that way; it's just that Ant is the easiest way to integrate with our existing libraries of modules. Thanks, Anthony. On Feb 24, 2010, at 10:57 AM, Doug MacEachern wrote: > Hi Anthony, > > The only Sigar ant tasks that I'm aware of are for building the native binaries. Interested to hear what you had in mind? Anthony Shortland [ Developer | ControlTier Open Source Project | mobile: 650.215.3117 aim: ant...@me... yahoo: anthony.shortland irc.freenode.net: #controltier skype: anthony.shortland ] ControlTier Software Inc. is now DTO Solutions Inc. |
From: Chakresh <sig...@hy...> - 2010-02-26 18:17:06
|
Hi Doug Running with gdb did not crash. Below is snapshot of the screen [New Thread 2199584782672 (LWP 17758)] [New Thread 2199584815440 (LWP 17759)] [New Thread 2199584848208 (LWP 17760)] Sigar version.......java=1.6.3.0, native=1.6.3.0 Build date..........java=02/22/2010 09:33 PM, native=02/24/2010 05:11 PM SCM rev.............java=exported, native=exported Archlib.............libsigar-s390x-linux.so Current fqdn........suse27.dpf.gov.br Hostname............suse27 Current user........root OS description......SuSE 10 OS name.............Linux OS arch.............s390x OS machine..........s390x OS version..........2.6.16.27-0.9-default OS patch level......unknown OS vendor...........SuSE OS vendor version...10 OS code name........ OS data model.......64 OS cpu endian.......null Java vm version.....2.3 Java vm vendor......IBM Corporation Java home.........../opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5 [New Thread 2199587649872 (LWP 17761)] [Thread 2199584782672 (zombie) exited] [Thread 2199587649872 (zombie) exited] [Thread 2199584815440 (zombie) exited] [Thread 2199584848208 (zombie) exited] [Thread 2199583697232 (zombie) exited] [Thread 2199583730000 (zombie) exited] Program exited normally. (gdb) q suse27:/opt/nsol/build/hyperic-sigar-1.6.3-src/bindings/java/sigar-bin/lib # ll total 993 -rw-r--r-- 1 rafael.rzm users 586131 Feb 24 17:11 libsigar-s390x-linux.so -rw-r--r-- 1 rafael.rzm users 423878 Feb 24 17:11 sigar.jar |
From: <pn...@hy...> - 2010-02-26 18:12:24
|
Author: pnguyen Date: 2010-02-26 10:12:06 -0800 (Fri, 26 Feb 2010) New Revision: 14326 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14326 Modified: trunk/src/org/hyperic/hq/bizapp/agent/client/SecureAgentConnection.java Log: [HHQ-3694] Allow the post handshake timeout to be configurable via a system property. Modified: trunk/src/org/hyperic/hq/bizapp/agent/client/SecureAgentConnection.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/agent/client/SecureAgentConnection.java 2010-02-26 09:34:39 UTC (rev 14325) +++ trunk/src/org/hyperic/hq/bizapp/agent/client/SecureAgentConnection.java 2010-02-26 18:12:06 UTC (rev 14326) @@ -6,7 +6,7 @@ * normal use of the program, and does *not* fall under the heading of * "derived work". * - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * Copyright (C) [2004-2010], Hyperic, Inc. * This file is part of HQ. * * HQ is free software; you can redistribute it and/or modify @@ -54,7 +54,9 @@ extends AgentConnection { private static final String PROP_READ_TIMEOUT = "agent.readTimeOut"; + private static final String PROP_POST_HANDSHAKE_TIMEOUT = "agent.postHandshakeTimeOut"; private static final int READ_TIMEOUT = 60000; + private static final int POST_HANDSHAKE_TIMEOUT = 60000; private String agentAddress; private int agentPort; @@ -78,7 +80,9 @@ private SSLSocket getSSLSocket(SSLSocketFactory factory, String host, - int port, int timeout) + int port, + int readTimeout, + int postHandshakeTimeout) throws IOException { SSLSocket socket; @@ -89,19 +93,18 @@ //XXX we could check if the jre is at the required patch level if (!JDK.IS_IBM) { socket = (SSLSocket)factory.createSocket(); - socket.connect(new InetSocketAddress(host, port), timeout); + socket.connect(new InetSocketAddress(host, port), readTimeout); } else { socket = (SSLSocket)factory.createSocket(host, port); } // Set the socket timeout during the initial handshake to detect - // connection issues with the agent. The timeout is reset to 0 - // (unlimited) post handshake, preserving the behavior for 3.1 and - // prior. - socket.setSoTimeout(timeout); + // connection issues with the agent. + socket.setSoTimeout(readTimeout); socket.startHandshake(); - socket.setSoTimeout(0); + // [HHQ-3694] The timeout is set to a post handshake value. + socket.setSoTimeout(postHandshakeTimeout); return socket; } @@ -138,17 +141,28 @@ try { // Check for configured agent read timeout from System properties - int timeout; - String readTimeout = System.getProperty(PROP_READ_TIMEOUT); + int readTimeout; try { - timeout = Integer.parseInt(readTimeout); + readTimeout = + Integer.parseInt(System.getProperty(PROP_READ_TIMEOUT)); } catch (NumberFormatException e) { - timeout = READ_TIMEOUT; + readTimeout = READ_TIMEOUT; } + + // Check for configured agent post handshake timeout + // from System properties + int postHandshakeTimeout; + try { + postHandshakeTimeout = + Integer.parseInt(System.getProperty(PROP_POST_HANDSHAKE_TIMEOUT)); + } catch (NumberFormatException e) { + postHandshakeTimeout = POST_HANDSHAKE_TIMEOUT; + } factory = context.getSocketFactory(); sock = getSSLSocket(factory, this.agentAddress, - this.agentPort, timeout); + this.agentPort, readTimeout, + postHandshakeTimeout); } catch(IOException exc){ throw new AgentConnectionException("Unable to connect to " + this.agentAddress + ":" + |
From: Chakresh <sig...@hy...> - 2010-02-26 17:45:21
|
Hi Doug Sorry for confusing you with other outputs. I copied the jar files as you suggested and ran test command under gdb, It point to line 208 in javasigar.c OS vendor...........SuSE OS vendor version...10 OS code name........ OS data model.......64 OS cpu endian.......null Java vm version.....2.3 Java vm vendor......IBM Corporation Java home.........../opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5 TestLog.testCreate.........................ok TestInvoker.testCreate..................... Program received signal SIGSEGV, Segmentation fault. ---Type <return> to continue, or q <return> to quit--- [Switching to Thread 2199025135696 (LWP 4218)] 0x00000200219e2d7e in sigar_get_jpointer (env=0x8002f200, obj=0x801d13a0) at /opt/nsol/build/hyperic-sigar-1.6.3-src/bindings/java/src/jni/javasigar.c:208 208 if (jsigar->open_status != SIGAR_OK) { Backtrace output (gdb) backtrace #0 0x00000200219e2d7e in sigar_get_jpointer (env=0x8002f200, obj=0x801d13a0) at /opt/nsol/build/hyperic-sigar-1.6.3-src/bindings/java/src/jni/javasigar.c:208 #1 0x00000200219eab5c in Java_org_hyperic_sigar_Mem_gather (env=0x8002f200, obj=0x801d13a8, sigar_obj=0x801d13a0) at /opt/nsol/build/hyperic-sigar-1.6.3-src/bindings/java/build/src/javasigar_generated.c:561 #2 0x00000200002cdccc in L48 () from /opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5/bin/libj9vm23.so #3 0x000002000027df00 in JVM_InvokeMethod () from /opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5/bin/j9vm/libjvm.so #4 0x0000020000025360 in JVM_InvokeMethod () from /opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5/bin/classic/libjvm.so #5 0x000002002168ef86 in Java_sun_reflect_NativeMethodAccessorImpl_invoke0 () from /opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5/bin/libjava.so #6 0x000002002057ef74 in ?? () #7 0x000002000027df00 in JVM_InvokeMethod () from /opt/nsol/nsAaka/common/tptools/ibm/LINUX/jre1.5/bin/j9vm/libjvm.so Another issue is that i have access to this specific machine only for 1 more day, so if you want me to run more tests, please let me know Thanks Chakresh |
From: Chakresh <sig...@hy...> - 2010-02-26 17:45:17
|
Hi Doug Looking at the output for ant verbose, i see that compilation is done with fPIC flag but not linking. Do you suspect this could be an issue? [cc] gcc -O2 -Wall -m64 -c -fPIC -DSIGAR_LINUX -D_REENTRANT -I/opt/nsolutions/sigar-test-compile/hyperic-sigar-1.6.3-src/include -I/opt/nsolutions/sigar- test-compile/hyperic-sigar-1.6.3-src/src/os/linux -I/opt/nsolutions/sigar-test-compile/hyperic-sigar-1.6.3-src/bindings/java/build/src -I/opt/nsolutions/sigar-t est-compile/hyperic-sigar-1.6.3-src/bindings/java/src/jni -I/opt/ibm/java2-s390x-50/include -I/opt/ibm/java2-s390x-50/include/linux /opt/nsolutions/sigar-test-c ompile/hyperic-sigar-1.6.3-src/bindings/java/build/src/sigar_version.c [cc] Starting link [cc] gcc -m64 -shared -o libsigar-s390x-linux.so ../vmcontrol_wrapper.o ../javasigar.o ../sigar_signal.o ../sigar_util.o ../sigar_version.o ../sigar.o .. /sigar_format.o ../linux_sigar.o ../sigar_cache.o ../sigar_fileinfo.o ../sigar_ptql.o ../javavmware.o ../sigar_getline.o Can you help me how i can do linking also with fPIC flag? thanks Chakresh |
From: Doug M. <dma...@vm...> - 2010-02-26 17:45:17
|
Hi Anthony, I'm more familar with Chef's Ohai that Puppet's Facter, but I believe they provide similar data. Here's an Ohai plugin that the Ruby version of Sigar: http://github.com/dougm/ohai/tree/hax/lib/ohai/plugins/sigar/ This generic plugin provides support for HP-UX and AIX, here's how the ohai output looks: http://dougm.github.com/ohai/ohai-hpux.json http://dougm.github.com/ohai/ohai-aix.json The sigar plugin would work on other platforms too, but Ohai already has their own wrappers around system commands. You could certainly leverage Sigar to provide the same data to ControlTier via Ant tasks and/or Groovy. If the tasks are generic enough, we could also fold them into the Sigar distro if you're interested in that path. Let us know if we can help out! -Doug On Feb 24, 2010, at 11:33 AM, Anthony Shortland wrote: > Hi Doug, > > One way to look at the ControlTier framework is that we "extend Ant for use as a deployment tool" ... i.e. ControlTier is a Java framework whose systems or module language is Ant. > > We've traditionally stuck to application life-cycle process automation (web applications based on Apache HTTP, Tomcat, JBoss and a host of other platforms), as opposed to system provisioning (like Puppet or Chef, etc), but you're probably aware that there is a degree of overlap between these domains of activity. > > It's here that I'm interested in Sigar Ant tasks. It would be really sweet to use your library to gain access to system state values of one sort or another ... a bit like Puppet's "Facter" facility if you're familiar with that. Even at the simplest level such data would be really useful. For example, we could include checks in our implementations to ensure sufficient disk space is available ahead of installing a software package, etc. > > We do have bindings to all sorts of other scripting languages (notably Groovy) so we can leverage library that way; it's just that Ant is the easiest way to integrate with our existing libraries of modules. > > Thanks, > > Anthony. > > On Feb 24, 2010, at 10:57 AM, Doug MacEachern wrote: > >> Hi Anthony, >> >> The only Sigar ant tasks that I'm aware of are for building the native binaries. Interested to hear what you had in mind? > > Anthony Shortland > [ Developer | ControlTier Open Source Project | mobile: 650.215.3117 aim: ant...@me... yahoo: anthony.shortland irc.freenode.net: #controltier skype: anthony.shortland ] > > ControlTier Software Inc. is now DTO Solutions Inc. > |
From: Chakresh <sig...@hy...> - 2010-02-26 17:45:15
|
Hi Doug Thanks for the response. zVM A and zVM B are running SLES9 and are 64-bit kernel servers. I compiled both 390 and s390x sigar files on SLES9 in our lab and they work fine on zVM A but on zVM B only s390 version works. When i try to run s390x sigar files, i do get the output for the version command but after that i get JVM crash. Below is the output suse04:/opt/nsol/build/hyperic-sigar-1.6.3-src/bindings/java/sigar-bin/lib # /opt/ibm/java2-s390x-50/jre/bin/java -jar sigar.jar version Sigar version.......java=1.6.3.0, native=1.6.3.0 Build date..........java=02/22/2010 09:33 PM, native=02/22/2010 09:33 PM SCM rev.............java=exported, native=exported Archlib.............libsigar-s390x-linux.so Current fqdn........suse04.dpf.gov.br Hostname............suse04 Current user........root OS description......SuSE 9 OS name.............Linux OS arch.............s390x OS machine..........s390x OS version..........2.6.5-7.308-s390x OS patch level......unknown OS vendor...........SuSE OS vendor version...9 OS code name........ OS data model.......64 OS cpu endian.......null Java vm version.....2.3 Java vm vendor......IBM Corporation Java home.........../opt/ibm/java2-s390x-50/jre Unhandled exception Type=Segmentation error vmState=0x00000000 J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=3b339738 Signal_Code=00000001 Handler1=00000200002A2B04 Handler2=00000200002F9EE4 InaccessibleAddress=0000000022936000 gpr0=0000000000000020 gpr1=00000000229364F0 gpr2=000000008002CB00 gpr3=0000020022A2D9FE gpr4=0000020022A0CB04 gpr5=0000000000000020 gpr6=0000000000000001 gpr7=00000200225F5E10 gpr8=000000008002CB00 gpr9=00000200225F5E10 gpr10=00000200225F5E10 gpr11=000000008002CB00 gpr12=0000000000000000 gpr13=000000008002CB00 gpr14=0000020022A0CB04 gpr15=000003FFFFFFDF40 psw=0000020022A0CB1A mask=0705E00180000000 fpc=0008000000000000 fpr0 428e800000000000 (f: 0.000000, d: 4.191888e+12) fpr1 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr2 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr3 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr4 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr5 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr6 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr7 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr8 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr9 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr10 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr11 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr12 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr13 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr14 0000000000000000 (f: 0.000000, d: 0.000000e+00) fpr15 0000000000000000 (f: 0.000000, d: 0.000000e+00) Module=/opt/nsol/build/hyperic-sigar-1.6.3-src/bindings/java/sigar-bin/lib/libsigar-s390x-linux.so Module_base_address=0000020022A00000 Target=2_30_20060915_08260_BHdSMr (Linux 2.6.5-7.308-s390x) CPU=s390x (2 logical CPUs) (0x139adc000 RAM) JVMDUMP006I Processing Dump Event "gpf", detail "" - Please Wait. Looking at the javacore file, below is a snippet NULL ------------------------------------------------------------------------ 0SECTION THREADS subcomponent dump routine NULL ================================= NULL 1XMCURTHDINFO Current Thread Details NULL ---------------------- 3XMTHREADINFO "main" (TID:0x0000000080032800, sys_thread_t:0x000000008001B030, state:R, native ID:0x0000000000004A99) prio=5 4XESTACKTRACE at org/hyperic/sigar/Sigar.nativeClose(Native Method) 4XESTACKTRACE at org/hyperic/sigar/Sigar.close(Sigar.java:229) 4XESTACKTRACE at org/hyperic/sigar/cmd/Shell.shutdown(Shell.java:196) 4XESTACKTRACE at org/hyperic/sigar/cmd/Shell.main(Shell.java:230) 4XESTACKTRACE at sun/reflect/NativeMethodAccessorImpl.invoke0(Native Method) 4XESTACKTRACE at sun/reflect/NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp l.java:79) 4XESTACKTRACE at sun/reflect/DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc essorImpl.java:43) 4XESTACKTRACE at java/lang/reflect/Method.invoke(Method.java:618) 4XESTACKTRACE at org/hyperic/sigar/cmd/Runner.main(Runner.java:214(Compiled Code)) Please let me know if you need any other information. Appreciate your help Thanks Chakresh |
From: <bo...@hy...> - 2010-02-26 09:34:49
|
Author: bob Date: 2010-02-26 01:34:39 -0800 (Fri, 26 Feb 2010) New Revision: 14325 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14325 Modified: trunk/etc/version.properties Log: Release 4.3.0 build #1361 Modified: trunk/etc/version.properties =================================================================== --- trunk/etc/version.properties 2010-02-25 23:58:13 UTC (rev 14324) +++ trunk/etc/version.properties 2010-02-26 09:34:39 UTC (rev 14325) @@ -1,3 +1,3 @@ -#Wed Feb 24 00:29:14 PST 2010 +#Fri Feb 26 00:34:19 PST 2010 version=4.3.0 -build=1360 +build=1361 |
From: <gla...@hy...> - 2010-02-25 23:58:24
|
Author: glaullon Date: 2010-02-25 15:58:13 -0800 (Thu, 25 Feb 2010) New Revision: 14324 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14324 Modified: trunk/plugins/db2jdbc/ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/CachedJDBCMeasurement.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DBManagerMeasurement.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBase8ServerDetector.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseMeasurement.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseServerDetector.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DefaultServerDetector.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/Measurement.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/MemoryPoolMeasurement.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableMeasurement.java trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableSpaceMeasurement.java Log: Remove 1.5 annotations. Property changes on: trunk/plugins/db2jdbc ___________________________________________________________________ Name: svn:ignore - manifest.mf nbproject build.xml test + build-lib manifest.mf build db2-jdbc-plugin.jar bin nbproject build.xml hq.properties test Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/CachedJDBCMeasurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/CachedJDBCMeasurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/CachedJDBCMeasurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -27,11 +27,9 @@ private static final String EXEC_TIME_ATTR = "QueryExecTime"; private static final Hashtable cache = new Hashtable(); - @Override protected void initQueries() { } - @Override protected String getDefaultURL() { return ""; } Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DBManagerMeasurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DBManagerMeasurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DBManagerMeasurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -12,7 +12,6 @@ */ public class DBManagerMeasurement extends Measurement { - @Override protected String getQuery(Metric metric) { if (getLog().isDebugEnabled()) { getLog().debug("*******************"); Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBase8ServerDetector.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBase8ServerDetector.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBase8ServerDetector.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -6,6 +6,7 @@ package org.hyperic.hq.plugin.db2jdbc; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import org.hyperic.hq.product.AutoServerDetector; import org.hyperic.hq.product.PluginException; @@ -20,7 +21,6 @@ */ public class DataBase8ServerDetector extends DataBaseServerDetector { - @Override protected List discoverServices(ConfigResponse config) throws PluginException { List res = new ArrayList(); String type = getTypeInfo().getName(); @@ -30,30 +30,32 @@ * Table */ String schema = config.getValue("db2.jdbc.user").toUpperCase(); - List<String> tbl = getList(config, "select TABLE_NAME from table (SNAPSHOT_TABLE('sample', -2)) as T"); // XXX revisar si se pueden sacar de otro sitio WHERE TABSCHEMA='" + schema + "'"); - for (String tbName : tbl) { + Iterator tbl = getList(config, "select TABLE_NAME from table (SNAPSHOT_TABLE('sample', -2)) as T").iterator(); // XXX revisar si se pueden sacar de otro sitio WHERE TABSCHEMA='" + schema + "'"); + while (tbl.hasNext()) { + String tbName = (String) tbl.next(); // if (!tbName.toUpperCase().startsWith("SYS")) { - ServiceResource tb = new ServiceResource(); - tb.setType(type + " Table"); - tb.setServiceName("Table " + schema + "." + tbName); + ServiceResource tb = new ServiceResource(); + tb.setType(type + " Table"); + tb.setServiceName("Table " + schema + "." + tbName); - ConfigResponse conf = new ConfigResponse(); - conf.setValue("table", tbName); - conf.setValue("schema", schema); - setProductConfig(tb, conf); - tb.setMeasurementConfig(); - tb.setResponseTimeConfig(new ConfigResponse()); - tb.setControlConfig(); + ConfigResponse conf = new ConfigResponse(); + conf.setValue("table", tbName); + conf.setValue("schema", schema); + setProductConfig(tb, conf); + tb.setMeasurementConfig(); + tb.setResponseTimeConfig(new ConfigResponse()); + tb.setControlConfig(); - res.add(tb); + res.add(tb); // } } /** * Table Space */ - List<String> tbspl = getList(config, "select TABLESPACE_NAME from table (SNAPSHOT_TBS('sample', -2)) as T"); - for (String tbspName : tbspl) { + Iterator tbspl = getList(config, "select TABLESPACE_NAME from table (SNAPSHOT_TBS('sample', -2)) as T").iterator(); + while (tbspl.hasNext()) { + String tbspName = (String) tbspl.next(); ServiceResource bpS = new ServiceResource(); bpS.setType(type + " Table Space"); bpS.setServiceName("Table Space " + tbspName); @@ -71,8 +73,9 @@ /** * Buffer Pool */ - List<String> bpl = getList(config, "select BP_NAME from table (SNAPSHOT_BP('sample', -2)) as T"); - for (String bpName : bpl) { + Iterator bpl = getList(config, "select BP_NAME from table (SNAPSHOT_BP('sample', -2)) as T").iterator(); + while (bpl.hasNext()) { + String bpName = (String) bpl.next(); ServiceResource bpS = new ServiceResource(); bpS.setType(type + " Buffer Pool"); bpS.setServiceName("Buffer Pool " + bpName); @@ -92,24 +95,24 @@ */ /*List<String> mpl = getList(config, "SELECT concat(concat(POOL_ID, '|'), COALESCE(POOL_SECONDARY_ID,'')) as name FROM SYSIBMADM.SNAPDB_MEMORY_POOL where POOL_SECONDARY_ID is NULL or POOL_ID='BP'"); for (String mpN : mpl) { - String[] names = mpN.split("\\|"); - String mpId=names[0].trim(); - String mpSId=(names.length==2)?names[1].trim():""; - String mpName=(mpId+" "+mpSId).trim(); + String[] names = mpN.split("\\|"); + String mpId=names[0].trim(); + String mpSId=(names.length==2)?names[1].trim():""; + String mpName=(mpId+" "+mpSId).trim(); - ServiceResource mpS = new ServiceResource(); - mpS.setType(type + " Memory Pool"); - mpS.setServiceName("Memory Pool " + mpName); + ServiceResource mpS = new ServiceResource(); + mpS.setType(type + " Memory Pool"); + mpS.setServiceName("Memory Pool " + mpName); - ConfigResponse conf = new ConfigResponse(); - conf.setValue("pool_id", mpId); - conf.setValue("sec_pool_id", mpSId); - setProductConfig(mpS, conf); - mpS.setMeasurementConfig(); - mpS.setResponseTimeConfig(new ConfigResponse()); - mpS.setControlConfig(); + ConfigResponse conf = new ConfigResponse(); + conf.setValue("pool_id", mpId); + conf.setValue("sec_pool_id", mpSId); + setProductConfig(mpS, conf); + mpS.setMeasurementConfig(); + mpS.setResponseTimeConfig(new ConfigResponse()); + mpS.setControlConfig(); - res.add(mpS); + res.add(mpS); }*/ return res; Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseMeasurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseMeasurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseMeasurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -13,7 +13,6 @@ */ public class DataBaseMeasurement extends PoolMeasurement { - @Override protected void postProcessResults(Map results) { super.postProcessResults(results); results.put("LOCK_LIST_IN_USE", new MetricValue(((MetricValue) results.get("LOCK_LIST_IN_USE")).getValue() * 4)); Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseServerDetector.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseServerDetector.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DataBaseServerDetector.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -10,6 +10,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.regex.Matcher; @@ -28,7 +29,6 @@ private Pattern regExpDataBases = Pattern.compile("Database (\\d*) entry:"); //private Pattern regExpDataBases = Pattern.compile("Database name[^=]*= (\\S*)[^L]*Local database directory[^=]*= (\\S*)"); - @Override protected List discoverServices(ConfigResponse config) throws PluginException { getLog().debug("discoverServices config=" + config); List res = new ArrayList(); @@ -45,8 +45,9 @@ * Table Space */ String schema = user; - List<String> tbl = getList(config, "SELECT TABNAME FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA='" + schema + "'"); - for (String tbName : tbl) { + Iterator tbl = getList(config, "SELECT TABNAME FROM SYSIBMADM.ADMINTABINFO WHERE TABSCHEMA='" + schema + "'").iterator(); + while (tbl.hasNext()) { + String tbName = (String) tbl.next(); if (!tbName.toUpperCase().startsWith("SYS")) { ServiceResource tb = new ServiceResource(); tb.setType(type + " Table"); @@ -67,8 +68,9 @@ /** * Table Space */ - List<String> tbspl = getList(config, "SELECT TBSP_NAME FROM SYSIBMADM.TBSP_UTILIZATION where TBSP_TYPE='DMS'"); - for (String tbspName : tbspl) { + Iterator tbspl = getList(config, "SELECT TBSP_NAME FROM SYSIBMADM.TBSP_UTILIZATION where TBSP_TYPE='DMS'").iterator(); + while (tbspl.hasNext()) { + String tbspName =(String) tbspl.next(); ServiceResource bpS = new ServiceResource(); bpS.setType(type + " Table Space"); bpS.setServiceName("Table Space " + tbspName); @@ -86,8 +88,9 @@ /** * Buffer Pool */ - List<String> bpl = getList(config, "SELECT BP_NAME FROM SYSIBMADM.BP_HITRATIO"); - for (String bpName : bpl) { + Iterator bpl = getList(config, "SELECT BP_NAME FROM SYSIBMADM.BP_HITRATIO").iterator(); + while (bpl.hasNext()) { + String bpName = (String) bpl.next(); ServiceResource bpS = new ServiceResource(); bpS.setType(type + " Buffer Pool"); bpS.setServiceName("Buffer Pool " + bpName); @@ -105,8 +108,9 @@ /** * Mempory Pool */ - List<String> mpl = getList(config, "SELECT concat(concat(POOL_ID, '|'), COALESCE(POOL_SECONDARY_ID,'')) as name FROM SYSIBMADM.SNAPDB_MEMORY_POOL where POOL_SECONDARY_ID is NULL or POOL_ID='BP'"); - for (String mpN : mpl) { + Iterator mpl = getList(config, "SELECT concat(concat(POOL_ID, '|'), COALESCE(POOL_SECONDARY_ID,'')) as name FROM SYSIBMADM.SNAPDB_MEMORY_POOL where POOL_SECONDARY_ID is NULL or POOL_ID='BP'").iterator(); + while (mpl.hasNext()) { + String mpN = (String) mpl.next(); String[] names = mpN.split("\\|"); String mpId = names[0].trim(); String mpSId = (names.length == 2) ? names[1].trim() : ""; Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DefaultServerDetector.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DefaultServerDetector.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/DefaultServerDetector.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -35,7 +35,7 @@ private Pattern regExpInstall = Pattern.compile("([^ ]*) *(\\d*\\.\\d*\\.\\d*\\.\\d*) *([^ ]*)"); private boolean ISWin = false; private String db2ls; - private List<String> entry_types; + private List entry_types; private String list_database; public List getServerResources(ConfigResponse conf) throws PluginException { @@ -50,18 +50,18 @@ RegistryKey key = RegistryKey.LocalMachine.openSubKey("SOFTWARE\\IBM\\DB2\\InstalledCopies"); String instances[] = key.getSubKeyNames(); key.close(); - for (String instance : instances) { - key = RegistryKey.LocalMachine.openSubKey("SOFTWARE\\IBM\\DB2\\InstalledCopies\\" + instance + "\\CurrentVersion"); + for (int n=0;n<instances.length;n++) { + key = RegistryKey.LocalMachine.openSubKey("SOFTWARE\\IBM\\DB2\\InstalledCopies\\" + instances[n] + "\\CurrentVersion"); String version = key.getStringValue("Version") + "." + key.getStringValue("Release") + "." + key.getStringValue("Modification") + "." + key.getStringValue("Fix Level"); key.close(); - getLog().debug(instance + "-->" + version); + getLog().debug(instances[n] + "-->" + version); if (regExpVersion.matcher(version).find()) { - key = RegistryKey.LocalMachine.openSubKey("SOFTWARE\\IBM\\DB2\\InstalledCopies\\" + instance); + key = RegistryKey.LocalMachine.openSubKey("SOFTWARE\\IBM\\DB2\\InstalledCopies\\" + instances[n]); String path = key.getStringValue("DB2 Path Name"); key.close(); res.addAll(createServers(path.trim())); } else { - getLog().debug("[getServerResources] bad version: '" + instance + " " + version + "'"); + getLog().debug("[getServerResources] bad version: '" + instances[n] + " " + version + "'"); } } } catch (Win32Exception ex) { @@ -74,8 +74,8 @@ String sal = inputStreamAsString(cmd.getInputStream()); getLog().debug("[getServerResources] sal=" + sal); String[] installs = sal.split("\n"); - for (String install : installs) { - Matcher m = regExpInstall.matcher(install); + for (int n=0;n<installs.length;n++) { + Matcher m = regExpInstall.matcher(installs[n]); if (m.find()) { if (regExpVersion.matcher(m.group(2)).find()) { getLog().debug("[getServerResources] found: '" + m.group() + "'"); @@ -94,7 +94,6 @@ return res; } - @Override public void init(PluginManager manager) throws PluginException { db2ls = manager.getProperties().getProperty("db2.jdbc.db2ls", "db2ls"); Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/Measurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/Measurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/Measurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -28,7 +28,6 @@ private static final String EXEC_TIME_ATTR = "QueryExecTime"; private static final Hashtable cache = new Hashtable(); - @Override protected String getQuery(Metric metric) { if (getLog().isDebugEnabled()) { getLog().debug("*******************"); @@ -49,7 +48,6 @@ return sql; } - @Override protected void getDriver() throws ClassNotFoundException { try { Class.forName("com.ibm.db2.jcc.DB2Driver"); @@ -59,13 +57,11 @@ } } - @Override protected Connection getConnection(String url, String user, String pass) throws SQLException { getLog().debug("[getConnection] url='" + url + "' user='" + user + "' pass='******'"); return DriverManager.getConnection(url, user, pass); } - @Override Map processResulSet(ResultSet rs, Metric metric) throws MetricNotFoundException { Map res = new HashMap(); String prefix = ""; Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/MemoryPoolMeasurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/MemoryPoolMeasurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/MemoryPoolMeasurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -14,14 +14,12 @@ */ public class MemoryPoolMeasurement extends Measurement { - @Override protected String getQuery(Metric metric) { String query = super.getQuery(metric); query = query.replaceAll("POOL_SECONDARY_ID=''", "POOL_SECONDARY_ID is NULL"); return query; } - @Override protected void postProcessResults(Map results) { results.put("POOL_CUR_SIZE_USED", new MetricValue(((MetricValue) results.get("POOL_CUR_SIZE")).getValue() / ((MetricValue) results.get("POOL_CONFIG_SIZE")).getValue())); results.put("POOL_WATERMARK_USED", new MetricValue(((MetricValue) results.get("POOL_WATERMARK")).getValue() / ((MetricValue) results.get("POOL_CONFIG_SIZE")).getValue())); Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableMeasurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableMeasurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableMeasurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -16,7 +16,6 @@ */ public class TableMeasurement extends Measurement { - @Override public MetricValue getValue(Metric metric) throws MetricUnreachableException, MetricNotFoundException { MetricValue res; try { @@ -31,7 +30,6 @@ return res; } - @Override protected void postProcessResults(Map results) { if (results.get("DATA_OBJECT_P_SIZE") != null) { results.put("TOTAL_SIZE", new MetricValue(((MetricValue) results.get("DATA_OBJECT_P_SIZE")).getValue() + Modified: trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableSpaceMeasurement.java =================================================================== --- trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableSpaceMeasurement.java 2010-02-25 21:50:12 UTC (rev 14323) +++ trunk/plugins/db2jdbc/src/org/hyperic/hq/plugin/db2jdbc/TableSpaceMeasurement.java 2010-02-25 23:58:13 UTC (rev 14324) @@ -13,7 +13,6 @@ */ public class TableSpaceMeasurement extends PoolMeasurement { - @Override protected void postProcessResults(Map results) { super.postProcessResults(results); if (results.get("TBSP_UTILIZATION_PERCENT") != null) { |
From: <sc...@hy...> - 2010-02-25 21:50:21
|
Author: scottmf Date: 2010-02-25 13:50:12 -0800 (Thu, 25 Feb 2010) New Revision: 14323 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14323 Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java Log: fix int error Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-25 18:18:18 UTC (rev 14322) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-25 21:50:12 UTC (rev 14323) @@ -522,7 +522,8 @@ try { if (alertType instanceof GalertEscalationAlertType) { - isAlertNotFound = (GalertManagerEJBImpl.getOne().getAlertLog(s.getAlertId()) == null); + isAlertNotFound = + GalertManagerEJBImpl.getOne().getAlertLog(new Integer(s.getAlertId())) == null; } else if (alertType instanceof ClassicEscalationAlertType) { // HHQ-3499, need to make sure that the alertId that is pointed to by // the escalation still exists |
Author: trader Date: 2010-02-25 10:18:18 -0800 (Thu, 25 Feb 2010) New Revision: 14322 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14322 Added: trunk/unittest/src/org/hyperic/hq/appdef/server/ trunk/unittest/src/org/hyperic/hq/appdef/server/session/ trunk/unittest/src/org/hyperic/hq/appdef/server/session/ServerTests.java Modified: trunk/src/org/hyperic/hq/appdef/server/session/Server.java Log: [HHQ-3697] [HPD-223] NPE in Server.matchesValueObject() -- install path did not have a null check. Re-factored for readability. Added unittests. Modified: trunk/src/org/hyperic/hq/appdef/server/session/Server.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/server/session/Server.java 2010-02-25 01:13:21 UTC (rev 14321) +++ trunk/src/org/hyperic/hq/appdef/server/session/Server.java 2010-02-25 18:18:18 UTC (rev 14322) @@ -240,25 +240,64 @@ public boolean matchesValueObject(ServerValue obj) { - boolean matches = true; - matches = super.matchesValueObject(obj) && - (getName() != null ? this.getName().equals(obj.getName()) - : (obj.getName() == null)) && - (getDescription() != null ? - this.getDescription().equals(obj.getDescription()) - : (obj.getDescription() == null)) && - (getLocation() != null ? - this.getLocation().equals(obj.getLocation()) - : (obj.getLocation() == null)) && - (isRuntimeAutodiscovery() == obj.getRuntimeAutodiscovery()) && - (getInstallPath().equals(obj.getInstallPath())) && - (getAutoinventoryIdentifier() != null ? - getAutoinventoryIdentifier().equals( - obj.getAutoinventoryIdentifier()) - : (obj.getAutoinventoryIdentifier() == null)); - - return matches; + return super.matchesValueObject(obj) && + nameMatches(obj) && + descriptionMatches(obj) && + locationMatches(obj) && + runtimeAutoDiscoveryMatches(obj) && + installPathMatches(obj) && + autoInventoryIdentifierMatches(obj); } + + private boolean nameMatches(ServerValue obj) + { + if (getName() == null) { + return obj.getName() == null; + } else { + return getName().equals(obj.getName()); + } + } + + private boolean descriptionMatches(ServerValue obj) + { + if (getDescription() == null) { + return obj.getDescription() == null; + } else { + return getDescription().equals(obj.getDescription()); + } + } + + private boolean locationMatches(ServerValue obj) + { + if (getLocation() == null) { + return obj.getLocation() == null; + } else { + return getLocation().equals(obj.getLocation()); + } + } + + private boolean runtimeAutoDiscoveryMatches(ServerValue obj) + { + return isRuntimeAutodiscovery() == obj.getRuntimeAutodiscovery(); + } + + private boolean installPathMatches(ServerValue obj) + { + if (getInstallPath() == null) { + return obj.getInstallPath() == null; + } else { + return getInstallPath().equals(obj.getInstallPath()); + } + } + + private boolean autoInventoryIdentifierMatches(ServerValue obj) + { + if (getAutoinventoryIdentifier() == null) { + return obj.getAutoinventoryIdentifier() == null; + } else { + return getAutoinventoryIdentifier().equals(obj.getAutoinventoryIdentifier()); + } + } /** * Validate a new service value object to be hosted by this server Added: trunk/unittest/src/org/hyperic/hq/appdef/server/session/ServerTests.java =================================================================== --- trunk/unittest/src/org/hyperic/hq/appdef/server/session/ServerTests.java (rev 0) +++ trunk/unittest/src/org/hyperic/hq/appdef/server/session/ServerTests.java 2010-02-25 18:18:18 UTC (rev 14322) @@ -0,0 +1,151 @@ +package org.hyperic.hq.appdef.server.session; + +import junit.framework.TestCase; + +import org.hyperic.hq.appdef.shared.ServerValue; + +public class ServerTests extends TestCase { + + private static final String NAME = "Fred"; + private static final String DESC = "Caveman"; + private static final String LOC = "Bedrock"; + private static final String INST_PATH = "/down/the/street"; + private static final String AID = "Flintstone"; + + public void testNullServerAndNullServerValue() throws Exception { + + Server s = new Server(new Integer(1)); + ServerValue sv = new ServerValue(); + + assertTrue(s.matchesValueObject(sv)); + } + + public void testNameMatch() throws Exception { + Server s = new Server(new Integer(1)); + s.setName(NAME); + ServerValue sv = new ServerValue(); + assertFalse(s.matchesValueObject(sv)); + + sv.setName(NAME); + assertTrue(s.matchesValueObject(sv)); + + s.setName(null); + assertFalse(s.matchesValueObject(sv)); + + sv.setName(null); + assertTrue(s.matchesValueObject(sv)); + } + + public void testDescriptionMatch() throws Exception { + Server s = new Server(new Integer(1)); + s.setDescription(DESC); + ServerValue sv = new ServerValue(); + assertFalse(s.matchesValueObject(sv)); + + sv.setDescription(DESC); + assertTrue(s.matchesValueObject(sv)); + + s.setDescription(null); + assertFalse(s.matchesValueObject(sv)); + + sv.setDescription(null); + assertTrue(s.matchesValueObject(sv)); + } + + public void testLocationMatch() throws Exception { + Server s = new Server(new Integer(1)); + s.setLocation(LOC); + ServerValue sv = new ServerValue(); + assertFalse(s.matchesValueObject(sv)); + + sv.setLocation(LOC); + assertTrue(s.matchesValueObject(sv)); + + s.setLocation(null); + assertFalse(s.matchesValueObject(sv)); + + sv.setLocation(null); + assertTrue(s.matchesValueObject(sv)); + } + + public void testRuntimeDiscoveryMatch() throws Exception { + Server s = new Server(new Integer(1)); + s.setRuntimeAutodiscovery(false); + ServerValue sv = new ServerValue(); + sv.setRuntimeAutodiscovery(false); + assertTrue(s.matchesValueObject(sv)); + + s.setRuntimeAutodiscovery(true); + assertFalse(s.matchesValueObject(sv)); + + sv.setRuntimeAutodiscovery(true); + assertTrue(s.matchesValueObject(sv)); + + s.setRuntimeAutodiscovery(false); + assertFalse(s.matchesValueObject(sv)); + } + + public void testInstallPathMatch() throws Exception { + Server s = new Server(new Integer(1)); + s.setInstallPath(INST_PATH); + ServerValue sv = new ServerValue(); + assertFalse(s.matchesValueObject(sv)); + + sv.setInstallPath(INST_PATH); + assertTrue(s.matchesValueObject(sv)); + + s.setInstallPath(null); + assertFalse(s.matchesValueObject(sv)); + + sv.setInstallPath(null); + assertTrue(s.matchesValueObject(sv)); + } + + public void testAutoInventoryIdentifierMatch() throws Exception { + Server s = new Server(new Integer(1)); + s.setAutoinventoryIdentifier(AID); + ServerValue sv = new ServerValue(); + assertFalse(s.matchesValueObject(sv)); + + sv.setAutoinventoryIdentifier(AID); + assertTrue(s.matchesValueObject(sv)); + + s.setAutoinventoryIdentifier(null); + assertFalse(s.matchesValueObject(sv)); + + sv.setAutoinventoryIdentifier(null); + assertTrue(s.matchesValueObject(sv)); + } + + public void testAllMatching() throws Exception { + Server s = new Server(new Integer(1)); + s.setName(NAME); + ServerValue sv = new ServerValue(); + sv.setName(NAME); + assertTrue(s.matchesValueObject(sv)); + + s.setDescription(DESC); + sv.setDescription(DESC); + assertTrue(s.matchesValueObject(sv)); + + s.setLocation(LOC); + sv.setLocation(LOC); + assertTrue(s.matchesValueObject(sv)); + + s.setRuntimeAutodiscovery(false); + sv.setRuntimeAutodiscovery(false); + assertTrue(s.matchesValueObject(sv)); + + s.setRuntimeAutodiscovery(true); + sv.setRuntimeAutodiscovery(true); + assertTrue(s.matchesValueObject(sv)); + + s.setInstallPath(INST_PATH); + sv.setInstallPath(INST_PATH); + assertTrue(s.matchesValueObject(sv)); + + s.setAutoinventoryIdentifier(AID); + sv.setAutoinventoryIdentifier(AID); + assertTrue(s.matchesValueObject(sv)); + } +} |
From: <dcr...@hy...> - 2010-02-25 01:13:30
|
Author: dcrutchf Date: 2010-02-24 17:13:21 -0800 (Wed, 24 Feb 2010) New Revision: 14321 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14321 Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java Log: Incorporated feedback regarding logging Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-25 00:45:15 UTC (rev 14320) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-25 01:13:21 UTC (rev 14321) @@ -60,14 +60,12 @@ import org.hyperic.hq.events.Notify; import org.hyperic.hq.events.server.session.Action; import org.hyperic.hq.events.server.session.ActionManagerEJBImpl; -import org.hyperic.hq.events.server.session.Alert; import org.hyperic.hq.events.server.session.AlertDAO; import org.hyperic.hq.events.server.session.AlertRegulator; import org.hyperic.hq.events.server.session.ClassicEscalationAlertType; import org.hyperic.hq.events.server.session.SessionBase; import org.hyperic.hq.escalation.server.session.EscalatableCreator; import org.hyperic.hq.galerts.server.session.GalertEscalationAlertType; -import org.hyperic.hq.galerts.server.session.GalertLog; import org.hyperic.hq.galerts.server.session.GalertManagerEJBImpl; import org.hyperic.util.units.FormattedNumber; import org.hyperic.util.units.UnitNumber; @@ -86,9 +84,7 @@ public class EscalationManagerEJBImpl implements SessionBean { - private final Log log = LogFactory.getLog(EscalationManagerEJBImpl.class); - private final boolean debug = log.isDebugEnabled(); - + private final Log log = LogFactory.getLog(EscalationManagerEJBImpl.class); private final EscalationDAO _esclDAO; private final EscalationStateDAO _stateDAO; @@ -226,6 +222,8 @@ public void deleteEscalation(AuthzSubject subject, Escalation e) throws PermissionException, ApplicationException { + final boolean debug = log.isDebugEnabled(); + SessionBase.canRemoveEscalation(subject.getId()); List alertTypes = EscalationAlertType.getAll(); @@ -476,6 +474,8 @@ * @ejb:interface-method */ public void executeState(Integer stateId) { + final boolean debug = log.isDebugEnabled(); + // Use a get() so that the state is retrieved from the // database (in case the escalation state was deleted // in a separate session when ending an escalation). |
From: <dcr...@hy...> - 2010-02-25 01:10:29
|
Author: dcrutchf Date: 2010-02-24 16:45:15 -0800 (Wed, 24 Feb 2010) New Revision: 14320 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14320 Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java trunk/src/org/hyperic/hq/galerts/server/session/GalertLogDAO.java trunk/src/org/hyperic/hq/galerts/server/session/GalertManagerEJBImpl.java Log: [HQ-2068] - Group Alerts fires without Escalation Scheme (revised) Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-24 23:59:11 UTC (rev 14319) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-25 00:45:15 UTC (rev 14320) @@ -522,7 +522,7 @@ try { if (alertType instanceof GalertEscalationAlertType) { - isAlertNotFound = (GalertManagerEJBImpl.getOne().findAlertLog(s.getAlertId()) == null); + isAlertNotFound = (GalertManagerEJBImpl.getOne().getAlertLog(s.getAlertId()) == null); } else if (alertType instanceof ClassicEscalationAlertType) { // HHQ-3499, need to make sure that the alertId that is pointed to by // the escalation still exists Modified: trunk/src/org/hyperic/hq/galerts/server/session/GalertLogDAO.java =================================================================== --- trunk/src/org/hyperic/hq/galerts/server/session/GalertLogDAO.java 2010-02-24 23:59:11 UTC (rev 14319) +++ trunk/src/org/hyperic/hq/galerts/server/session/GalertLogDAO.java 2010-02-25 00:45:15 UTC (rev 14320) @@ -57,6 +57,10 @@ return (GalertLog)super.findById(id); } + GalertLog getById(Integer id) { + return (GalertLog)super.get(id); + } + void save(GalertLog log) { super.save(log); } Modified: trunk/src/org/hyperic/hq/galerts/server/session/GalertManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/galerts/server/session/GalertManagerEJBImpl.java 2010-02-24 23:59:11 UTC (rev 14319) +++ trunk/src/org/hyperic/hq/galerts/server/session/GalertManagerEJBImpl.java 2010-02-25 00:45:15 UTC (rev 14320) @@ -371,6 +371,13 @@ /** * @ejb:interface-method */ + public GalertLog getAlertLog(Integer id) { + return _logDAO.getById(id); + } + + /** + * @ejb:interface-method + */ public GalertLog findAlertLog(Integer id) { return _logDAO.findById(id); } |
From: <dcr...@hy...> - 2010-02-24 23:59:21
|
Author: dcrutchf Date: 2010-02-24 15:59:11 -0800 (Wed, 24 Feb 2010) New Revision: 14319 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14319 Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java Log: [HQ-2068] - Group Alerts fires without Escalation Scheme Modified: trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-24 23:25:45 UTC (rev 14318) +++ trunk/src/org/hyperic/hq/escalation/server/session/EscalationManagerEJBImpl.java 2010-02-24 23:59:11 UTC (rev 14319) @@ -67,6 +67,8 @@ import org.hyperic.hq.events.server.session.SessionBase; import org.hyperic.hq.escalation.server.session.EscalatableCreator; import org.hyperic.hq.galerts.server.session.GalertEscalationAlertType; +import org.hyperic.hq.galerts.server.session.GalertLog; +import org.hyperic.hq.galerts.server.session.GalertManagerEJBImpl; import org.hyperic.util.units.FormattedNumber; import org.hyperic.util.units.UnitNumber; import org.hyperic.util.units.UnitsConstants; @@ -84,8 +86,9 @@ public class EscalationManagerEJBImpl implements SessionBean { - private final Log _log = LogFactory.getLog(EscalationManagerEJBImpl.class); - + private final Log log = LogFactory.getLog(EscalationManagerEJBImpl.class); + private final boolean debug = log.isDebugEnabled(); + private final EscalationDAO _esclDAO; private final EscalationStateDAO _stateDAO; @@ -230,16 +233,19 @@ EscalationAlertType aType = (EscalationAlertType)i.next(); if (aType.escalationInUse(e)) { - if (_log.isDebugEnabled()) { - _log.debug("Escalation [" + e.getId() + ", " + e.getName() + + if (debug) { + log.debug("Escalation [" + e.getId() + ", " + e.getName() + "] in use by:"); + Collection performers = aType.getPerformersOfEscalation(e); + for (Iterator j=performers.iterator(); j.hasNext(); ) { PerformsEscalations p = (PerformsEscalations)j.next(); - _log.debug("[" + p.getName() + " id=" + p.getId() +"]"); + log.debug("[" + p.getName() + " id=" + p.getId() +"]"); } } + throw new ApplicationException("The escalation is currently " + "in use"); } @@ -343,12 +349,12 @@ if (!alert.getAlertInfo().isFixed()) { EscalationState curState = new EscalationState(alert); _stateDAO.save(curState); - _log.debug("Escalation started: state=" + curState.getId()); + log.debug("Escalation started: state=" + curState.getId()); EscalationRuntime.getInstance().scheduleEscalation(curState); started = true; } } catch (ResourceDeletedException e) { - _log.debug(e); + log.debug(e); } finally { if (!started) { EscalationRuntime.getInstance() @@ -357,7 +363,7 @@ } } catch (InterruptedException e) { - _log.error("Failed to start escalation for " + + log.error("Failed to start escalation for " + "alert def id="+def.getId()+ "; type="+def.getAlertType().getCode(), e); } @@ -376,7 +382,7 @@ // Checks if there is a committed escalation state for this def. existsInDb = _stateDAO.find(def) != null; } catch (Exception e) { - _log.warn("There is already one escalation in progress for " + + log.warn("There is already one escalation in progress for " + "alert def id="+def.getId()+ "; type="+def.getAlertType().getCode()); // HHQ-915: A hibernate exception will occur when looking up the @@ -411,7 +417,7 @@ } if (existsInCache || existsInDb) { - _log.debug("startEscalation called on [" + def + "] but it was " + + log.debug("startEscalation called on [" + def + "] but it was " + "already running"); } @@ -490,31 +496,54 @@ // XXX -- Need to make sure the application is running before // we allow this to proceed - final boolean debug = _log.isDebugEnabled(); - if (debug) _log.debug("Executing state[" + s.getId() + "]"); + if (debug) log.debug("Executing state[" + s.getId() + "]"); if (actionIdx >= e.getActions().size()) { if (e.isRepeat() && e.getActions().size() > 0) { actionIdx = 0; // Loop back } else { - if (debug) _log.debug("Reached the end of the escalation state[" + + if (debug) log.debug("Reached the end of the escalation state[" + s.getId() + "]. Ending it"); endEscalation(s); return; } } - + eAction = (EscalationAction)e.getActions().get(actionIdx); action = eAction.getAction(); - AlertDAO dao = DAOFactory.getDAOFactory().getAlertDAO(); - Alert alert = dao.getById(new Integer(s.getAlertId())); - // HHQ-3499, need to make sure that the alertId that is pointed to by - // the escalation still exists - if (alert == null) { + // TODO this needs to be looked at further. Ideally, I should be able to + // call getEscalatables and do a simple null check or catch an expected + // HQ exception and not worry about checking for alert types explicitly + // but after talking with folks about it, sounds like it would require + // touching a lot more plumbing code... + EscalationAlertType alertType = s.getAlertType(); + boolean isAlertNotFound = true; + + try { + if (alertType instanceof GalertEscalationAlertType) { + isAlertNotFound = (GalertManagerEJBImpl.getOne().findAlertLog(s.getAlertId()) == null); + } else if (alertType instanceof ClassicEscalationAlertType) { + // HHQ-3499, need to make sure that the alertId that is pointed to by + // the escalation still exists + AlertDAO dao = DAOFactory.getDAOFactory().getAlertDAO(); + + isAlertNotFound = (dao.getById(new Integer(s.getAlertId())) == null); + } + } catch(Exception ex) { + log.warn("An unexpected error has occurred while checking if alert with id[" + s.getAlertId() + " and escalation type [" + s.getAlertType().getClass().getName() + "] exists.", ex); + // ...could not determine whether or not the alert exists, so we'll assume it doesn't and + // end the escalation below... + } + + if (isAlertNotFound) { + if (debug) log.debug("Alert with id[" + s.getAlertId() + " and escalation type [" + s.getAlertType().getClass().getName() + "] was not found. Canceling escalation..."); + endEscalation(s); - return; + + return; } + Escalatable esc = getEscalatable(s); // HQ-1348: End escalation if alert is already fixed @@ -530,7 +559,7 @@ long nextTime = System.currentTimeMillis() + Math.max(offset, eAction.getWaitTime()); - if (debug) _log.debug("Moving onto next state of escalation, but chillin' for " + if (debug) log.debug("Moving onto next state of escalation, but chillin' for " + eAction.getWaitTime() + " ms"); s.setNextAction(actionIdx + 1); s.setNextActionTime(nextTime); @@ -555,7 +584,7 @@ String detail = action.executeAction(esc.getAlertInfo(), execInfo); type.logActionDetails(esc, action, detail, null); } catch(Exception exc) { - _log.error("Unable to execute action [" + + log.error("Unable to execute action [" + action.getClassName() + "] for escalation definition [" + s.getEscalation().getName() + "]", exc); } @@ -711,7 +740,7 @@ // Strange condition, since we shouldn't have an escalation state if // it has been fixed. if (e.getAlertInfo().isFixed()) { - _log.warn("Found a fixed alert inside an escalation. alert=" + + log.warn("Found a fixed alert inside an escalation. alert=" + alertId + " defid=" + def.getDefinitionInfo().getId() + " alertType=" + state.getAlertType().getCode()); return false; @@ -764,14 +793,14 @@ boolean acknowledged = !fixed; if (esc.getAlertInfo().isFixed()) { - _log.warn(subject.getFullName() + " attempted to fix or " + + log.warn(subject.getFullName() + " attempted to fix or " + " acknowledge the " + type + " id=" + alertId + " but it was already fixed"); return; } if (state == null && acknowledged) { - _log.debug(subject.getFullName() + " acknowledged alertId[" + + log.debug(subject.getFullName() + " acknowledged alertId[" + alertId + "] for type [" + type + "], but it wasn't " + "running or was previously acknowledged. " + "Button Masher?"); @@ -786,7 +815,7 @@ if (moreInfo == null || moreInfo.trim().length() == 0) moreInfo = "(Fixed by " + subject.getFullName() + ")"; - _log.debug(subject.getFullName() + " has fixed alertId=" + alertId); + log.debug(subject.getFullName() + " has fixed alertId=" + alertId); type.changeAlertState(esc, subject, EscalationStateChange.FIXED); type.logActionDetails(esc, null, moreInfo, subject); if (state != null) @@ -797,13 +826,13 @@ } if (state.getAcknowledgedBy() != null) { - _log.warn(subject.getFullName() + " attempted to acknowledge "+ + log.warn(subject.getFullName() + " attempted to acknowledge "+ type + " alert=" + alertId + " but it was already "+ "acknowledged by " + state.getAcknowledgedBy().getFullName()); return; } - _log.debug(subject.getFullName() + " has acknowledged alertId=" + + log.debug(subject.getFullName() + " has acknowledged alertId=" + alertId); type.changeAlertState(esc, subject, EscalationStateChange.ACKNOWLEDGED); @@ -857,7 +886,7 @@ Notify n = (Notify) a.getInitializedAction(); n.send(alert, EscalationStateChange.FIXED, msg, notified); } catch(Exception e) { - _log.warn("Unable to send fixed notification alert", e); + log.warn("Unable to send fixed notification alert", e); } } } @@ -894,7 +923,7 @@ EscalationStateChange.ACKNOWLEDGED, msg, notified); } catch(Exception e) { - _log.warn("Unable to send notification alert", e); + log.warn("Unable to send notification alert", e); } } @@ -977,7 +1006,7 @@ * @ejb:interface-method */ public void startup() { - _log.info("Starting up Escalation subsystem"); + log.info("Starting up Escalation subsystem"); // Need to initialize the types that we know EscalationAlertType[] types = new EscalationAlertType[] { @@ -985,13 +1014,13 @@ GalertEscalationAlertType.GALERT }; - boolean debugLog = _log.isDebugEnabled(); + boolean debugLog = log.isDebugEnabled(); for (Iterator i=_stateDAO.findAll().iterator(); i.hasNext(); ) { EscalationState state = (EscalationState)i.next(); if (debugLog) { - _log.debug("Loading escalation state [" + state.getId() + "]"); + log.debug("Loading escalation state [" + state.getId() + "]"); } EscalationRuntime.getInstance().scheduleEscalation(state); } |
From: <gla...@hy...> - 2010-02-24 23:09:23
|
Author: glaullon Date: 2010-02-24 15:09:15 -0800 (Wed, 24 Feb 2010) New Revision: 14317 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14317 Added: trunk/plugins/db2jdbc/ Log: |