incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r874466 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/sling-health-check-tool.html
Date Tue, 13 Aug 2013 13:22:22 GMT
Author: buildbot
Date: Tue Aug 13 13:22:21 2013
New Revision: 874466

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Aug 13 13:22:21 2013
@@ -1 +1 @@
-1513470
+1513475

Modified: websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html
(original)
+++ websites/staging/sling/trunk/content/documentation/bundles/sling-health-check-tool.html
Tue Aug 13 13:22:21 2013
@@ -85,36 +85,60 @@
       
       
       <h1>Sling Health Check Tool</h1>
-      <p>Based on simple <em>HealthCheck</em> OSGi services, the Sling
Health Check Tool ("hc" in short form) is used to 
+      <p>Based on simple <code>HealthCheck</code> OSGi services, the Sling
Health Check Tool ("hc" in short form) is used to 
 check the health of live Sling systems, based on inputs like JMX MBean attribute values,
OSGi framework 
 information, Sling requests status, etc.</p>
-<p>Health checks are easily extensible either by configuring the supplied default <em>HealthCheck</em>
services, or
+<p>Health checks are easily extensible either by configuring the supplied default <code>HealthCheck</code>
services, or
 by implementing your own services.  </p>
 <p>Default rules are provided to check JMX MBeans, OSGi bundle states, disabling of
default Sling 
 accounts, JUnit tests results and the output of scripts written in any language supported
by Sling.</p>
 <p>The source code of the hc modules is at <a href="http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/healthcheck">http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/healthcheck</a>.</p>
-<h2 id="whats-a-healthcheck">What's a HealthCheck ?</h2>
-<p>A <em>HealthCheck</em> is just an OSGi service that returns a <em>Result</em>.</p>
+<h2 id="whats-a-healthcheck">What's a <code>HealthCheck</code> ?</h2>
+<p>A <code>HealthCheck</code> is just an OSGi service that returns a <code>Result</code>.</p>
+<div class="codehilite"><pre><span class="n">public</span> <span
class="n">interface</span> <span class="n">HealthCheck</span> <span
class="p">{</span>
+
+    <span class="o">/**</span> <span class="n">Execute</span> <span
class="n">this</span> <span class="n">health</span> <span class="n">check</span>
<span class="n">and</span> <span class="k">return</span> <span
class="n">a</span> <span class="p">{@</span><span class="n">link</span>
<span class="n">Result</span><span class="p">}</span> <span class="o">*/</span>
+    <span class="n">public</span> <span class="n">Result</span> <span
class="n">execute</span><span class="p">();</span>
+
+    <span class="o">/**</span> <span class="n">Additional</span>
<span class="p">(</span><span class="n">static</span><span class="p">)</span>
<span class="n">information</span> <span class="n">about</span>
+     <span class="o">*</span>  <span class="n">this</span> <span
class="n">check</span><span class="p">.</span> <span class="p">{@</span><span
class="n">link</span> <span class="n">Constants</span><span class="p">}</span>
<span class="n">defines</span>
+     <span class="o">*</span>  <span class="n">some</span> <span
class="n">well</span><span class="o">-</span><span class="n">known</span>
<span class="n">property</span> <span class="n">names</span><span
class="p">.</span>
+     <span class="o">*/</span>
+    <span class="n">public</span> <span class="n">Map</span><span
class="o">&lt;</span><span class="n">String</span><span class="p">,</span>
<span class="n">String</span><span class="o">&gt;</span> <span
class="n">getInfo</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+
+
 <p>The Result provides a <em>Status</em> (OK, WARN, CRITICAL etc.) and
a human-readable log which provides additional info, including optional DEBUG messages
-that help troubleshooting. The Result log is not stricly tied to a logging model, so HealthChecks
are free to invent their own types of logging messages
+that help troubleshooting. The Result log is not stricly tied to a logging model, so <code>HealthCheck</code>s
are free to invent their own types of logging messages
 if needed. See the <code>org.apache.sling.hc.api.Result</code> class in the for
more details. </p>
-<p>HealthCheck services can be selected for execution based on their <em>tags</em>.
The <em>HealthCheckFilter</em> utility 
-accepts positive and negative tag parameters, so that <code>-security,sling</code>
for example selects all HealthCheck
+<p><code>HealthCheck</code> services can be selected for execution based
on their <em>tags</em>. The <code>HealthCheckFilter</code> utility

+accepts positive and negative tag parameters, so that <code>-security,sling</code>
for example selects all <code>HealthCheck</code>
 having the <em>sling</em> tag but not the <em>security</em> tag.
</p>
+<h2 id="health-check-subsystem-bundles">Health Check subsystem bundles</h2>
+<p>The Health Check subsystem consists of the following bundles:</p>
+<ul>
+<li>The only required bundle is <code>org.apache.sling.hc.api</code> which
provides the API and some utility classes.</li>
+<li><code>org.apache.sling.hc.healthchecks</code> provides default <code>HealthCheck</code>
services, described below.</li>
+<li><code>org.apache.sling.hc.webconsole</code> provides the Webconsole
plugin described below.</li>
+<li><code>org.apache.sling.hc.jmx</code> provides JMX MBeans to execute
<code>HealthCheck</code>s.</li>
+<li><code>org.apache.sling.hc.samples</code> provides sample OSGi configurations
that demonstrate the default <code>HealthCheck</code>s. These configurations are
provided as Sling content, so the Sling Installer is required to activate them.</li>
+</ul>
 <h2 id="executing-health-checks">Executing health checks</h2>
 <p>Besides executing them programatically, Health checks can be executed via a webconsole
plugin or via JMX, 
 see below for more details.</p>
-<h2 id="default-healthcheck-services-and-samples">Default HealthCheck services and
samples</h2>
-<p>As of mid-August 2013, the <code>org.apache.sling.hc.samples</code>
bundle provides OSGi configurations that demonstrate the following HealthCheck services:</p>
+<h2 id="default-healthcheck-services-and-samples">Default <code>HealthCheck</code>
services and samples</h2>
+<p>A useful set of default <code>HealthCheck</code>s is provided by the
<code>org.apache.sling.hc.healthchecks</code> bundle. </p>
+<p>The <code>org.apache.sling.hc.samples</code> bundle provides OSGi configurations
that demonstrate the following <code>HealthCheck</code> services:</p>
 <ul>
 <li><code>JmxAttributeHealthCheck</code> checks the value of a single JMX
attribute and supports ranges like <em>between 12 and 42</em>.  </li>
 <li><code>SlingRequestStatusHealthCheck</code> checks the HTTP status of
Sling requests.  </li>
 <li><code>ScriptableHealthCheck</code> evaluates an expression written
in any scripting language that Sling supports, and provides bindings to access JMX attributes
and OSGi bundles states. </li>
 <li><code>DefaultLoginsHealthCheck</code> can be used to verify that the
default Sling logins fail.  </li>
-<li><code>CompositeHealthCheck</code> executes a set of HealthCheck selected
by tags, useful to get higher-level management views.</li>
+<li><code>CompositeHealthCheck</code> executes a set of <code>HealthCheck</code>
selected by tags, useful to get higher-level management views.</li>
 </ul>
 <h2 id="configuring-health-checks">Configuring health checks</h2>
-<p>Health check services are created via OSGi configurations.</p>
+<p><code>HealthCheck</code> services are created via OSGi configurations.</p>
 <p>Here's a <code>ScriptableHealthCheck</code> example configuration provided
by the <code>org.apache.sling.hc.samples</code> bundle:</p>
 <p>PID = org.apache.sling.hc.ScriptableHealthCheck.1523a6db-12324
   Factory PID = org.apache.sling.hc.ScriptableHealthCheck
@@ -123,24 +147,25 @@ see below for more details.</p>
   hc.tags = [bundles, script]
   expression = osgi.inactiveBundlesCount() == 0 
   language.extension = ecma</p>
-<p>Properties starting with the <code>hc.</code> prefix should be provided
by all HealthCheck services.</p>
+<p>Properties starting with the <code>hc.</code> prefix should be provided
by all <code>HealthCheck</code> services.</p>
 <h2 id="webconsole-plugin">Webconsole plugin</h2>
-<p>A webconsole plugin at <code>/system/console/healthcheck</code> allows
for executing health checks, optionally selected
-based on their tags.</p>
+<p>If the <code>org.apache.sling.hc.webconsole</code> bundle is active,
a webconsole plugin 
+at <code>/system/console/healthcheck allows for executing health checks, optionally
selected
+based on their tags (positive and negative selection, see</code>HealthCheckFilter`
mention above).</p>
 <p>The DEBUG logs of health checks can optionally be displayed, and an option allows
for showing only health
 checks that have a non-OK status.</p>
 <p>The screenshot below shows an example, as of svn revision 1513462.</p>
 <p><img alt="" src="sling-hc-plugin.jpg" /></p>
 <h2 id="jmx-access-to-health-checks">JMX access to health checks</h2>
-<p>A JMX MBean is created for each HealthCheck, which gives access to the <code>Result</code>
and the log, as shown
-on the screenshot below.   </p>
-<p>The MBean name defaults to the <code>hc.name</code> service property
of the <em>HealthCheck</em>, but if an
+<p>If the <code>org.apache.sling.hc.jmx</code> bundle is active, a JMX
MBean is created for each <code>HealthCheck</code>.</p>
+<p>The MBean gives access to the <code>Result</code> and the log, as shown
on the screenshot below.   </p>
+<p>The MBean name defaults to the <code>hc.name</code> service property
of the <em><code>HealthCheck</code></em>, but if an
 <code>hc.mbean.name</code> property is provided it is used instead. That property
can include a a slash 
 (as in <code>composite/security</code>) to define the MBean service name, which
by default is <em>HealthCheck</em>.</p>
 <p>The example configurations of the <code>org.apache.sling.hc.samples</code>
bundle demonstrate the various features.</p>
 <p><img alt="" src="jconsole-hc.jpg" /></p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1513470 by bdelacretaz on Tue, 13 Aug 2013 13:11:10 +0000
+        Rev. 1513475 by bdelacretaz on Tue, 13 Aug 2013 13:22:13 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project



Mime
View raw message