modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java | 9 + modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml | 18 +++ modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml | 51 ++++++---- 3 files changed, 59 insertions(+), 19 deletions(-)
New commits: commit dee518db2b8c61813bf1cdad229f6388c0c4ec61 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Nov 29 12:18:17 2011 -0500
[Bug 758261 - A bad drift definition can prevent agent startup] Add more aggressive catching (Throwable) because it's better to skip detection for a problematic definition than it is to prevent agent startup.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java index c70b546..7b0752d 100644 --- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java +++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/drift/DriftManager.java @@ -152,9 +152,11 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri try { syncWithServer(r, d); schedulesQueue.addSchedule(new DriftDetectionSchedule(r.getId(), d)); - } catch (IOException e) { + + } catch (Throwable t) { + // catch throwable, don't prevent agent startup just due to a bad definition log.error("Failed to sync with server for " + toString(r.getId(), d) + ". Drift detection will not be " - + "scheduled.", e); + + "scheduled.", t); } }
@@ -681,7 +683,8 @@ public class DriftManager extends AgentService implements DriftAgentService, Dri // find out the type of base location that is specified by the drift def DriftDefinition.BaseDirectory baseDir = driftDefinition.getBasedir(); if (baseDir == null) { - throw new IllegalArgumentException("Missing basedir in drift definition"); + throw new IllegalArgumentException("Base directory is null for drift definition [" + + driftDefinition.getName() + "]"); }
// based on the type of base location, determine the root base directory
commit b7e1b73df192f483f91dff5831b13d2741cdd165 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Nov 30 10:43:54 2011 -0500
[Bug 758565 - Add drift templates to JBAS WAR/EAR resources] After reverting the changes to support EAR/WAR/Embedded WAR types for AS-4 and AS-5 plugins, this now adds back drift templates for EAR and WAR types. The Embedded WAR support will be added back in later, when the repo is open for the plugin code changes required to offer that support.
diff --git a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml index b6ce5ec..e1b8d25 100644 --- a/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as-5/src/main/resources/META-INF/rhq-plugin.xml @@ -2313,6 +2313,15 @@ &deploymentContentConfigProps; </content>
+ <drift-definition + name="Template-Files" + description="Monitor files comprising the enterprise application archive (EAR). Use filters for more fine-grained monitoring. Or, create definitions only on the embedded WAR resources themselves."> + <basedir> + <value-context>measurementTrait</value-context> + <value-name>custom.path</value-name> + </basedir> + </drift-definition> + </service>
<service name="Web Application (WAR)" @@ -2364,6 +2373,15 @@ &deploymentContentConfigProps; </content>
+ <drift-definition + name="Template-Files" + description="Monitor files comprising the web application archive (WAR). Use filters for more fine-grained monitoring."> + <basedir> + <value-context>measurementTrait</value-context> + <value-name>custom.path</value-name> + </basedir> + </drift-definition> + <service name="Web Application Context" class="WebApplicationContextComponent" discovery="WebApplicationContextDiscoveryComponent" diff --git a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml index db4b8e5..d4d0874 100644 --- a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml +++ b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml @@ -259,8 +259,9 @@ </configuration> </content>
- <drift-definition name="Template-Base Files" - description="Monitor base application server files for drift. It defines monitoring for some standard sub-directories of the HOME directory. Note, it is not recommeded to monitor all files for an application server. There are many files, and many temp files."> + <drift-definition + name="Template-Base Files" + description="Monitor base application server files for drift. It defines monitoring for some standard sub-directories of the HOME directory. Note, it is not recommeded to monitor all files for an application server. There are many files, and many temp files."> <basedir> <value-context>pluginConfiguration</value-context> <value-name>jbossHomeDir</value-name> @@ -2267,6 +2268,15 @@ </configuration> </content>
+ <drift-definition + name="Template-Files" + description="Monitor files comprising the enterprise application archive (EAR). Use filters for more fine-grained monitoring. Or, create definitions only on the embedded WAR resources themselves."> + <basedir> + <value-context>pluginConfiguration</value-context> + <value-name>filename</value-name> + </basedir> + </drift-definition> + <service name="Embedded Web Application (WAR)" class="org.rhq.plugins.jbossas.WarComponent" discovery="org.rhq.plugins.jbossas.EmbeddedWarDiscoveryComponent" @@ -2460,55 +2470,55 @@ dataType="calltime" defaultOn="false" units="milliseconds" destinationType="URL" description="the minimum, maximum, and average response times for HTTP requests serviced by this webapp"/>
- <metric property="Servlet.MinResponseTime" displayName="Min. Servlet Resp. Time" + <metric property="Servlet.MinResponseTime" displayName="Min. Servlet Resp. Time" units="milliseconds" description="Minimum response time of a servlet"/>
- <metric property="Servlet.AvgResponseTime" displayName="Avg. Servlet Resp. Time" + <metric property="Servlet.AvgResponseTime" displayName="Avg. Servlet Resp. Time" units="milliseconds" description="Average response time of a servlet"/>
- <metric property="Servlet.MaxResponseTime" displayName="Max. Servlet Resp. Time" + <metric property="Servlet.MaxResponseTime" displayName="Max. Servlet Resp. Time" units="milliseconds" description="Maximum response time of a servlet"/>
- <metric property="Servlet.TotalTime" displayName="Total processing time" + <metric property="Servlet.TotalTime" displayName="Total processing time" units="milliseconds" description="Total processing time of the webapp" measurementType="trendsup"/>
- <metric property="Servlet.NumRequests" displayName="Requests served" + <metric property="Servlet.NumRequests" displayName="Requests served" units="none" description="Number of requests served by servlets" measurementType="trendsup" displayType="summary"/>
- <metric property="Servlet.NumErrors" displayName="Errors while processing" + <metric property="Servlet.NumErrors" displayName="Errors while processing" units="none" description="Number of errors while processing" measurementType="trendsup" displayType="summary"/>
- <metric property="Session.activeSessions" displayName="Currently Active Sessions" + <metric property="Session.activeSessions" displayName="Currently Active Sessions" units="none" description="Number active sessions for the webapp right now" />
- <metric property="Session.maxActive" displayName="Maximum number of Active Sessions" + <metric property="Session.maxActive" displayName="Maximum number of Active Sessions" units="none" description="Maximum number of active sessions for the webapp" />
- <metric property="Session.sessionCounter" displayName="Sessions created" + <metric property="Session.sessionCounter" displayName="Sessions created" units="none" description="Number of sessions created for the webapp" measurementType="trendsup" />
- <metric property="Session.expiredSessions" displayName="Expired Sessions" + <metric property="Session.expiredSessions" displayName="Expired Sessions" units="none" description="Number of expired sessions for the webapp" measurementType="trendsup" />
- <metric property="Session.rejectedSessions" displayName="Rejected Sessions" + <metric property="Session.rejectedSessions" displayName="Rejected Sessions" units="none" description="Number of sessions rejected for the webapp" measurementType="trendsup" />
- <metric property="Session.sessionAverageAliveTime" displayName="Session Average alive time" + <metric property="Session.sessionAverageAliveTime" displayName="Session Average alive time" units="seconds" description="Average alive time of a Sessions" />
- <metric property="Session.sessionMaxAliveTime" displayName="Max Session alive time" + <metric property="Session.sessionMaxAliveTime" displayName="Max Session alive time" units="seconds" description="Maximum alive time of a Sessions" />
- <metric property="Vhost.name" displayName="Vhost" dataType="trait" + <metric property="Vhost.name" displayName="Vhost" dataType="trait" description="Virtual hosts this app runs on"/>
<content name="file" displayName="WAR File" category="deployable" isCreationType="true"> @@ -2524,6 +2534,15 @@ </configuration> </content>
+ <drift-definition + name="Template-Files" + description="Monitor files comprising the web application archive (WAR). Use filters for more fine-grained monitoring."> + <basedir> + <value-context>pluginConfiguration</value-context> + <value-name>filename</value-name> + </basedir> + </drift-definition> + </service>
<service name="EJB3 Entity Tree Cache"
rhq-commits@lists.fedorahosted.org