Author: bdelacretaz
Date: Tue Sep 17 14:06:53 2013
New Revision: 1524048
URL: http://svn.apache.org/r1524048
Log:
Adapt Health Check docs to latest changes
Modified:
sling/site/trunk/content/documentation/bundles/sling-hc-plugin.jpg
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
Modified: sling/site/trunk/content/documentation/bundles/sling-hc-plugin.jpg
URL:
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/sling-hc-plugin.jpg?rev=1524048&r1=1524047&r2=1524048&view=diff
==============================================================================
Binary files - no diff available.
Modified:
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
URL:
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext?rev=1524048&r1=1524047&r2=1524048&view=diff
==============================================================================
---
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
(original)
+++
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
Tue Sep 17 14:06:53 2013
@@ -31,46 +31,51 @@ if needed. See the `org.apache.sling.hc.
The `HealthCheckFilter` utility accepts positive and negative tag parameters,
so that `-security,sling`
selects all `HealthCheck` having the `sling` tag but not the `security` tag,
for example.
-Besides executing them programatically, Health checks can be executed via a
webconsole plugin or via JMX,
+Besides executing them programmatically, Health checks can be executed via a
webconsole plugin or via JMX,
as described below.
## Health Check bundles
-The Health Check subsystem consists of the following bundles, which are
described below in more detail:
+The Health Check subsystem consists of the following bundles:
-* The only required bundle is `org.apache.sling.hc.api` which provides the API
and some utility classes.
-* `org.apache.sling.hc.healthchecks` provides default `HealthCheck` services.
-* `org.apache.sling.hc.webconsole` provides the Webconsole plugin.
-* `org.apache.sling.hc.jmx` provides JMX MBeans to execute `HealthCheck`s.
-* `org.apache.sling.hc.samples` provides sample OSGi configurations that
demonstrate the default `HealthCheck`s. These configurations are provided as
Sling content, so the Sling Installer is required to activate them.
+* The only required bundle is `org.apache.sling.hc.core` which provides the
API, some utility classes and some generally useful `HealthCheck` services.
+* `org.apache.sling.hc.support` provides more Sling-specific `HealthCheck`
services.
+* `org.apache.sling.hc.webconsole` provides the Webconsole plugin described
below.
+* `org.apache.sling.hc.jmx` provides JMX MBeans that execute `HealthCheck`s.
+* `org.apache.sling.hc.samples` provides sample OSGi configurations and
`HealthCheck` services. The sample configurations are provided as Sling
content, so the Sling Installer is required to activate them.
## Out-of-the-box `HealthCheck` services
-A useful set of default `HealthCheck`s is provided by the
`org.apache.sling.hc.healthchecks` bundle.
+The following default `HealthCheck` services are provided by the
`org.apache.sling.hc.core` bundle:
The `org.apache.sling.hc.samples` bundle provides OSGi configurations that
demonstrate them.
* `JmxAttributeHealthCheck` checks the value of a single JMX attribute and
supports ranges like _between 12 and 42_.
- * `SlingRequestStatusHealthCheck` checks the HTTP status of Sling requests.
* `ScriptableHealthCheck` evaluates an expression written in any scripting
language that Sling supports, and provides bindings to access JMX attributes
and OSGi bundles states.
- * `DefaultLoginsHealthCheck` can be used to verify that the default Sling
logins fail.
* `CompositeHealthCheck` executes a set of `HealthCheck` selected by tags,
useful for creating higher-level checks.
+And a few more Sling-specific ones are provided by the
`org.apache.sling.hc.support` bundle:
+
+ * `SlingRequestStatusHealthCheck` checks the HTTP status of Sling requests.
+ * `DefaultLoginsHealthCheck` can be used to verify that the default Sling
logins fail.
+
+Finally, the `org.apache.sling.hc.samples` bundle provides an example
`OsgiScriptBindingsProvider` for the default `ScriptableHealthCheck`,
+which provides OSGi-related information to health check script expressions.
+
## Configuring health checks
`HealthCheck` services are created via OSGi configurations, the details of
which are defined by each
service implementation.
-Here's a `ScriptableHealthCheck` example configuration provided by the
`org.apache.sling.hc.samples` bundle:
+As an example, here's a `ScriptableHealthCheck` configuration provided by the
`org.apache.sling.hc.samples` bundle:
Factory PID = org.apache.sling.hc.ScriptableHealthCheck
- PID = org.apache.sling.hc.ScriptableHealthCheck.1523a6db-12324
- hc.mbean.name = InactiveBundlesCheck
- hc.name = No inactive bundles
- hc.tags = [bundles, script]
- expression = osgi.inactiveBundlesCount() == 0
- language.extension = ecma
+ "hc.name" : "LoadedClassCount and ManagementSpecVersion are in range"
+ "hc.mbean.name" : "LoadedClassCount and ManagementSpecVersion"
+ "hc.tags" : [jvm, script]
+ "expression" : "jmx.attribute('java.lang:type=ClassLoading',
'LoadedClassCount') > 10 && jmx.attribute('java.lang:type=Runtime',
'ManagementSpecVersion') > 1"
+ "language.extension" : "ecma"
-The service properties starting with the `hc.` prefix in this example should
be provided by all
-`HealthCheck` services.
+The service properties starting with the `hc.` prefix in this example should
be provided by all `HealthCheck` services. The `hc.mbean.name`
+is optional, if not provided no MBean is created for that `HealthCheck`.
## Webconsole plugin
If the `org.apache.sling.hc.webconsole` bundle is active, a webconsole plugin
@@ -85,7 +90,9 @@ The screenshot below shows an example, a
<img src="sling-hc-plugin.jpg" style="max-width:700px" alt="Health Check
Webconsole Plugin"/>
## JMX access to health checks
-If the `org.apache.sling.hc.jmx` bundle is active, a JMX MBean is created for
each `HealthCheck` which has the service property 'hc.mbean.name' service
property set. All health check MBeans are registered in the domain
'org.apache.sling.healthcheck' with a type of 'HealthCheck'
+If the `org.apache.sling.hc.jmx` bundle is active, a JMX MBean is created for
each `HealthCheck` which has the
+service property 'hc.mbean.name' service property set. All health check MBeans
are registered in the
+domain 'org.apache.sling.healthcheck' with a type of 'HealthCheck'
The MBean gives access to the `Result` and the log, as shown on the screenshot
below.