Hello
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">
]>
<plugin>
<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"
value="Pid.PidFile.eq=/var/run/puppet/puppetd.pid"/>
<property name="INVENTORY_ID" value="${PROC_QUERY}"/>
<property name="DEFAULT_CONF"
value="/etc/puppet/puppet.conf"/>
<config>
<option name="process.query"
description="Process Query"
default="${PROC_QUERY}"/>
</config>
<plugin type="autoinventory"
class="org.hyperic.hq.product.DaemonDetector"/>
<plugin type="measurement"
class="org.hyperic.hq.product.MeasurementPlugin"/>
<plugin type="config_track"
class="org.hyperic.hq.product.ConfigFileTrackPlugin"/>
<metric name="Availability"
template="sigar:Type=ProcState,Arg=%process.query%:State"
indicator="true"/>
&process-metrics;
</server>
</plugin>
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
Thanks
Ed