View Only
  • 1.  help with a custom plugin that involes a control action

    Posted Dec 11, 2009 10:22 PM

    I am working on creating a plug-in that will allow me to trigger a control action if an alert occurs. I am using puppet now since the process goes down now and then but I want to expand this out to other software so that I can minimize the involvement of our support teams.

    here is the plugin

    <?xml version="1.0"?>

    <!DOCTYPE plugin [
    <!ENTITY process-metrics SYSTEM "/pdk/plugins/process-metrics.xml">


    <server name="Puppet">

    <!-- Use this helper class -->

    <plugin type="control" class="org.hyperic.hq.product.ScriptControlPlugin"/>

    <!-- Actions visible in UI-->
    <actions include="start,stop,restart,status"/>

    <property name="DEFAULT_PROGRAM" value="/sbin/service puppet "/>
    <property name="BACKGROUND_COMMAND" value="true"/>

    <property name="PROC_QUERY"

    <property name="INVENTORY_ID" value="${PROC_QUERY}"/>

    <property name="DEFAULT_CONF"

    <option name="process.query"
    description="Process Query"

    <plugin type="autoinventory"

    <plugin type="measurement"

    <plugin type="config_track"

    <metric name="Availability"




    When I deploy the plug-in in HQ I can see the metrics being collected and I can see the control options. The path to puppet control program is not right, its /usr/lib/ruby instead of the path I defined in the plug-in. The only that confuses me is how HQ actually restarts the process. Can I use the standard service command such as "/sbin/service puppet restart" or do I have to make a script that takes input and then deploy the script with the plug-in? This plug-in seems to work expect for the control action section



  • 2.  RE: help with a custom plugin that involes a control action

    Posted Dec 13, 2009 08:19 AM

    while I was writing a program I had to set BACKGROUND_COMMAND to false:

    <property name="BACKGROUND_COMMAND" value="false"/>

    I am not sure if the DEFAULT_PROGRAM can caontain white spaces. It is probably safer to write a wrapper that calls "/sbin/server puppet", passes the arguments like stop, start etc. and make it part of the plugin.
    <property name="DEFAULT_PROGRAM" value="/sbin/service puppet "/>

    Before you deploy the plugin and use it to create resources, it is recommended to run the plugin standalone. You will also find an example how to run control actions. It makes the debugging a lot easier.
    Have a look at:

    hope this helps,

  • 3.  RE: help with a custom plugin that involes a control action

    Posted Dec 13, 2009 07:54 PM
    I know how to manually invoke a plugin from the command line. I would like more information regarding how to invoke the control action. I would prefer to use a system tool such as the service command instead of having to write a wrapper script but if that is the answer then so be it. Thanks for your input.