Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95076FBE0 for ; Tue, 13 Aug 2013 13:45:08 +0000 (UTC) Received: (qmail 33684 invoked by uid 500); 13 Aug 2013 13:45:08 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 33614 invoked by uid 500); 13 Aug 2013 13:45:08 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 33604 invoked by uid 99); 13 Aug 2013 13:45:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Aug 2013 13:45:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Aug 2013 13:45:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1F81C23889BF; Tue, 13 Aug 2013 13:44:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1513486 - /sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext Date: Tue, 13 Aug 2013 13:44:43 -0000 To: commits@sling.apache.org From: bdelacretaz@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130813134443.1F81C23889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: bdelacretaz Date: Tue Aug 13 13:44:42 2013 New Revision: 1513486 URL: http://svn.apache.org/r1513486 Log: SLING-2987 - health check docs tweaks Modified: sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext 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=1513486&r1=1513485&r2=1513486&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 Aug 13 13:44:42 2013 @@ -4,8 +4,8 @@ Based on simple `HealthCheck` OSGi servi check the health of live Sling systems, based on inputs like JMX MBean attribute values, OSGi framework information, Sling requests status, etc. -Health checks are easily extensible either by configuring the supplied default `HealthCheck` services, or -by implementing your own services. +Health checks are easily extensible either by configuring the supplied default `HealthCheck` services, by +supplying MBeans that expose the required attributes, or by implementing your own `HealthCheck` services. The source code of the hc modules is at [http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/healthcheck](http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/healthcheck). @@ -15,7 +15,10 @@ A `HealthCheck` is just an OSGi service public interface HealthCheck { - /** Execute this health check and return a {@link Result} */ + /** Execute this health check and return a {@link Result} + * This is meant to execute quickly, access to external + * systems, for example, should be managed asynchronously. + */ public Result execute(); /** Additional (static) information about @@ -25,10 +28,9 @@ A `HealthCheck` is just an OSGi service public Map getInfo(); } - The Result provides a _Status_ (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 `HealthCheck`s are free to invent their own types of logging messages -if needed. See the `org.apache.sling.hc.api.Result` class for more details. +if needed. See the `org.apache.sling.hc.api.Result` class and its tests for more details. `HealthCheck` services can be selected for execution based on their `hc.tags` multi-value service property. @@ -60,7 +62,8 @@ The `org.apache.sling.hc.samples` bundle * `CompositeHealthCheck` executes a set of `HealthCheck` selected by tags, useful for creating higher-level checks. ## Configuring health checks -`HealthCheck` services are created via OSGi configurations. +`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: @@ -78,7 +81,7 @@ The service properties starting with the ## Webconsole plugin If the `org.apache.sling.hc.webconsole` bundle is active, a webconsole plugin at `/system/console/healthcheck` allows for executing health checks, optionally selected -based on their tags (positive and negative selection, see `HealthCheckFilter` mention above). +based on their tags (positive and negative selection, see the `HealthCheckFilter` mention above). 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.