Skip to end of metadata
Go to start of metadata

Control Plugins

Topics marked with * relate to HQ Enterprise-only features.

The ControlPlugin defines control actions and implements the doAction() method used to control resources. Like the Measurement Plugin, the method of control is left entirely to the plugin. Support classes are provided to assist with certain types of control:

  • JDBC
  • JMX
  • Script Execution
  • Windows Service Manager

Following are some examples of collection methods used by various plugins:

Collection Method Plugins that Use It
JMX JBoss, WebLogic, WebSphere
JDBC Mysql, PostgreSQL
Script Execution Apache, Tomcat
Windows Service Manager IIS, Apache, Tomcat

Feedback is welcome. Click Add Comment at the bottom of the page.

Properties

Property Use
BACKGROUND_COMMAND background.sh command silently fails when running  
DEFAULT_PROGRAM default control program  

Script Execution

Script Execution Plugin

Windows Service Manager

Code snippet with the required code to run Control Actions on a Windows Service.
Always specify the platform (platform="Win32") if you use a common plugin for Unix/Windows platforms.

Windows Service Manager Control Actions

ControlPlugin.doAction Method

Control actions are defined in the Plugin XML Descriptor. Server and Service resources can include an <actions> tag that will define the control actions that resource supports. Multiple control actions can be defined by separating the actions with a comma. For example:

Defining Control Actions

These actions are passed into doAction as a String argument. The plugin can then act accordingly. Each resource that supports control will have its own ControlPlugin instance. Configuration parameters defined within the Plugin XML Descriptor <config> tags can be retrieved using the ControlPlugin.getConfig method.

An example using a JBoss JMS Destination, which uses JMX for its control actions:

hq-plugin.xml
JBossJMSControlPlugin.java
Return to the Plugin Development Center.
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Feb 04, 2009

    Does the Script Execution Control plugin allow us to configure two control programs, for example, one for Start and one for Stop. I have an application which I want to control but has a separate script for starting and stopping the application.

    – EDIT –
    By the way, I am using XML form of plugin deployment.

  2. Feb 04, 2009

    Hi,

    sorry but you can only configure one control program. What do you think about using a wrapper that executes your scripts ?

    Cheers,
    Mirko

  3. Feb 04, 2009

    Yea. Thats what I am planning to do. Thanks for replying.

  4. Feb 05, 2009

    Great, please use the forums (http://forums.hyperic.com) if there are any upcoming questions about implementing your Control Actions.

    Cheers,
    Mirko

  5. Apr 30, 2009

    A short context of how the "action" string gets invoked might be helpful. Especially of interest would be how to nest plugins such that a supporting plugin might be invoked by another such. e.g. If a measurement plugin (which is not simple) needs information to be refreshed, how might IT pass this string to a control plugin?