You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (JIRA)" <ji...@apache.org> on 2013/04/12 17:36:18 UTC

[jira] [Commented] (SLING-2822) Muppet - extensible system health checking tool

    [ https://issues.apache.org/jira/browse/SLING-2822?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13630187#comment-13630187 ] 

Bertrand Delacretaz commented on SLING-2822:
--------------------------------------------

To test this, build the three bundles provided in the above github repository and install them on a Sling trunk instance.

Then, run the attached setup.bash script to create the nodes that define the demo rules (change the PORT if needed) and run them as follows:

$ curl http://localhost:8080/tmp/muppet.muppet.json

OK Rule: bundle.state:org.apache.sling.api active
OK Rule: Attempt to login as user admin LOGIN_OK
OK Rule: Attempt to login as user admin LOGIN_FAILED
OK Rule: bundle.state:non.existent.bundle BUNDLE_NOT_FOUND
OK Rule: bundle.state:groovy-all active

The output contains one line per rule (should be JSON, not implemented yet), with the result of the rule's execution and information on the rule itself.

Stopping the groovy-all bundle, for example, and running this request again, outputs

...
ERROR Rule: bundle.state:groovy-all active

See the attached nodes.json for the node structure that defines the rules used here - the data sources used in this example are OSGi bundles states and the SlingRepository to test logins.

This adds a new rule that takes a JMX bean as input:

curl -u admin:admin -Fnamespace=jmxbeans -FruleName=java.lang#type=ClassLoading -Fqualifier=LoadedClassCount -Fexpression="> 100" http://localhost:$P/tmp/muppet/jmx-loaded

And the corresponding output is

OK Rule: java.lang:type=ClassLoading:LoadedClassCount > 100

Additional RuleBuilder services can then be defined for other data sources.
                
> Muppet - extensible system health checking tool
> -----------------------------------------------
>
>                 Key: SLING-2822
>                 URL: https://issues.apache.org/jira/browse/SLING-2822
>             Project: Sling
>          Issue Type: Improvement
>          Components: Testing
>            Reporter: Bertrand Delacretaz
>            Assignee: Bertrand Delacretaz
>            Priority: Minor
>         Attachments: nodes.json, setup.bash
>
>
> I have created a prototype at https://github.com/bdelacretaz/muppet-prototype that we might want to move to our contrib folder.
> Muppet (it's like a Puppet, but different) allows you to check the health of a system by defining rules that (out of the box) verify things like the presence of specific OSGi bundles, JMX MBeans values, correct disabling of default Sling credentials, etc.
> New rule types can be defined by adding RuleBuilder OSGi services, there are several examples in this initial code.
> I'll add a how-to for this initial version here. 
> Known issues are:
> -The output does not indicate the value that causes a rule to fail
> -The servlet output is not JSON yet
> -Tags on rules would be nice to be able to run just the performance or security rules for example
> -A rule for checking OSGi configuration parameters would be useful.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira