help with a custom plugin that involes a control action
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
<!DOCTYPE plugin [ <!ENTITY process-metrics SYSTEM "/pdk/plugins/process-metrics.xml"> ]>
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
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 "/>
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.