VMware Cloud Community
reninj_hyperic
Contributor
Contributor

How to automate the creation of Platform Services in the agent

Hello,

We have a need to discover and monitor some basic OS level services/processes such as sshd, inetd, syslogd, etc.
We would like to automate the discovery of these as Platform Services at the agent level and monitor their process-availability automatically.

We also would like to create some Platform HTTP Service in the agent (automatically by reading some source for the list of URLs) to monitor some local URL's availability and response times.

Has anyone run into similar requirements before, and has knowledge of how to achieve this? If you have any Java snippets that does this or at least pointers to any documents about APIs to create platform services, that would be very helpful.

Thank you.
0 Kudos
4 Replies
admin
Immortal
Immortal

You might want to try a process monitor plugin:
http://support.hyperic.com/display/DOCSHQ30/Process+Monitor+Plugin

And adapt the example to your needs. For example to find ssh:
Pid.PidFile.eq=/var/run/sshd.pid

As per:
http://support.hyperic.com/display/DOCSHQ30/MultiProcess+service

--jeremy
reninj_hyperic
Contributor
Contributor

Thank you so much.

I believe I should be able to accomplish what I need to do, with the Information in the first link and the sendmail plugin example I found in the source code.
0 Kudos
reninj_hyperic
Contributor
Contributor

I had to add a plugin element to the xml and add autoinventory using daemondetector in order to make Hyperic agent discover the process. I got the example from sendmail-plugin.xml

Without that, the agent did not report anything for the process i wanted to monitor, even though it loads my plugin.xml

But, I am running into another problem, once the agent discovers this process using daemondetector, none of the metrics I defined show up or get monitored.

Did anyone run into this issue before?

Thanks in advance.



<?xml version="1.0"?>


<plugin>
<server name="csrss">
<property name="PROC_QUERY"
value="State.Name.eq=csrss"/>

<plugin type="autoinventory"
class="org.hyperic.hq.product.DaemonDetector"/>

<metric name="Availability"
alias="Availability"
template="sigar:Type=ProcState,Arg=State.Name.eq=csrss:State"
category="AVAILABILITY"
units="percentage"
collectionType="dynamic"
indicator="true"/>

</server>
</plugin>
0 Kudos
reninj_hyperic
Contributor
Contributor

I found the answer to the problem.

I had to add another plugin element for the measurement.
So, I added the following to the server definition and it worked fine.

<plugin type="measurement"
class="org.hyperic.hq.product.SigarMeasurementPlugin"/>


The only problem I seem to be left with is, when I use the DaemonDetector, I can not seem to be able to delete the resources. I shut down the agent, remove the plugin.xml, restart the agent, delete the resources from the Server console, and they come right back in the dashboard, to be added to the inventory.
0 Kudos