VMware Cloud Community
ebailey
Enthusiast
Enthusiast

automate creation of a script service for every platform

Greetings - I am looking to add a nagios plug-in to every server we have that runs puppet. The nagios plug-in runs a check the verifies whether or not puppet is running correctly. I can manually add the plug-in to a server using the script service, but of course I want to automate this process and I am wondering what is the best way to make that happen. Do I need to create a Hyperic Script plugin or is their another way?

Thanks

Ed
0 Kudos
4 Replies
admin
Immortal
Immortal

Hi Ed,

Just to be clear you're wanting to use HQ to add this nagios plugin or was nagios a typo? Maybe I'm just misunderstanding the task.
0 Kudos
ebailey
Enthusiast
Enthusiast

I want to add a script service to every server that is running puppet. The script service will execute a nagios plug-in that does a health check of the puppet process.

I already have a plug-in that adds puppet as a server to Hyperic. Is it possible to be add the script service to the puppet plugin I already have?

Thanks

Ed
0 Kudos
admin
Immortal
Immortal

Hi Ed,

You can add the a script service to your plugin. It shouldn't be very difficult. I took a peak at the last version you showed us on support and it should just be the matter of adding this as a service to the existing plugin.

If you give me a bit I can give you an example.
0 Kudos
ebailey
Enthusiast
Enthusiast

Hello - I have changed our puppet plugin a bit since I last sent it to support. I removed the control action. We are using the script alert instead to trigger a command to restart puppet instead. This is the plugin we are now using.

<?xml version="1.0"?>

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

<plugin>

<server name="Puppet">
<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>

I have a simple nagios plugin I want to run on every server that has puppet installed.

The plugin takes 7500 and 14000 as its inputs. The nagios plugin works fine with the script service in hq. Would I use the script plugin as an example to add the script service to the existing plugin?

Thanks

Ed
0 Kudos