VMware Cloud Community
tnine
Contributor
Contributor

Help creating a new custom service

Hi all,
I need to create a service monitor for an application with a few parameters. I can create the service, but I'm confused about what I need to put in the process query. Here is what I need to accomplish, but I can't find an example on the wiki. Any help would be greatly appreciated.

1. Monitor a standalone java process (the only other one besides the agent)
2. Monitor a log file for certain output, regular expression matching in the last 100 lines would be sufficient
3. Monitor the output file to make sure that the file is growing. IE. size(currentCheck) > size(lastCheck).

Can anyone give me a hint? I'm using Hyperic HQ 2.7 client and agent.

Message was edited by: tnine
Reply
0 Kudos
8 Replies
dougm_hyperic
VMware Employee
VMware Employee

(moving to hq-users)

On Jan 26, 2007, at 12:13 PM, Todd Nine wrote:

> Hi all,
> I need to create a service monitor for an application with a few
> parameters. I can create the service, but I'm confused about what
> I need to put in the process query. Here is what I need to
> accomplish, but I can't find an example on the wiki. Any help
> would be greatly appreciated.
>
> 1. Monitor a standalone java process (the only other one besides
> the agent)

You can monitor just the process itself with the Process service
(click New Platform Service from the platform view).
This query would match the java process other than the agent:
State.Name.eq=java,Args.-1.ne=org.hyperic.hq.agent.server.AgentDaemon

But it would be better to match the main class of your process:
State.Name.eq=java,Args.*.eq=your.package.MainClass

Or if you're using Java 5, you can monitor via JMX by clicking the
New Server link from the platform view and selecting Sun JVM 1.5

> 2. Monitor a log file for certain output, regular expression
> matching in the last 100 lines would be sufficient

New Platform Service -> FileServer File
Check the box to enable log tracking and enter your file name.
There's an optional field to enter a regex.

Note that log tracking in 2.7.x is only available with the Enterprise
subscription. It is available in the open source platform in the 3.0
version, which is currently in beta.

> 3. Monitor the output file to make sure that the file is growing.
> IE. size(currentCheck) > size(lastCheck).

The FileServer File service has a 'Size' metric. The alert
definition doesn't have a way to do this check. However, it could
probably be done by combining a "value changes" alert condition with
a script.
I can put together an example of how to do this and will follow up
when I have a chance to do that.


Reply
0 Kudos
tnine
Contributor
Contributor

Thanks for the reply. I was able to get my service working, and found the documentation I need below.

http://support.hyperic.com/confluence/display/SIGAR/PTQL

http://www.hyperic.com/support/docs/sigar/

I was able to find my Java service with the following.

State.Name.eq=java,Args.*.eq=com.purdueefcu.statements.GenerateStatements

However I'm not getting any metric data, cpu usage, mem usage etc. When I view configuration in monitoring, it displays "This resource does not have any monitoring Configuration Properties.". Is there something else I need to add to report data? I tried to add something regarding the CPU time, but I need to perform reporting, not equality checking to find a process. Also, when I shut down the Java process, it still shows as running in the headquarters server. I'm considering moving to the 3 beta since it provides more functionality I need. I've played with it at home, but is it stable enough for simple process monitoring and alerting?
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

Hi Todd,

What version of HQ are you currently running?
There was a bug fixed in 2.7.7 related to process services continuing
to show the green light when the process was no longer running:
http://jira.hyperic.com/browse/HHQ-427

This is also fixed in the current 3.0 beta, where functionally
process monitoring is the same as in 2.7.7.
The only configuration the Process service needs is the
process.query, the complete list of available metrics is here:
http://support.hyperic.com/confluence/display/DOCSHQ27/Process+service

Only those highlighted are enabled by default, to enable others see:
http://support.hyperic.com/confluence/display/DOCSHQ27/ui-2.5.2.1.2

Are you not able to collect process metrics other than availability?
What OS is your process running on?

On Jan 27, 2007, at 8:08 PM, Todd Nine wrote:

> Thanks for the reply. I was able to get my service working, and
> found the documentation I need below.
>
> http://support.hyperic.com/confluence/display/SIGAR/PTQL
>
> http://www.hyperic.com/support/docs/sigar/
>
> I was able to find my Java service with the following.
>
> State.Name.eq=java,Args.*.eq=com.purdueefcu.statements.GenerateStateme
> nts
>
> However I'm not getting any metric data, cpu usage, mem usage etc.
> When I view configuration in monitoring, it displays "This resource
> does not have any monitoring Configuration Properties.". Is there
> something else I need to add to report data? I tried to add
> something regarding the CPU time, but I need to perform reporting,
> not equality checking to find a process. Also, when I shut down
> the Java process, it still shows as running in the headquarters
> server. I'm considering moving to the 3 beta since it provides
> more functionality I need. I've played with it at home, but is it
> stable enough for simple process monitoring and alerting?
>



tnine
Contributor
Contributor

Excellent. Just an FYI, the site still shows 2.7.6 as the current download and links to that version on sourceforge, I had to go sourceforge to get the 2.7.7 version. I will install that now and check it. Do I need to install the 2.7.7 agent as well?
Reply
0 Kudos
tnine
Contributor
Contributor

I have upgrade both my server and my agent to 2.7.7, however the service still does not show as stopped. I have attached the screen shot, take a look at the process named "Statements Java Process". You can see it still shows as running, and I can't get any metrics from it. I've waited 20 minutes after stopping it, but the status doesn't seem to update. It also shows as running if I restart the statement1 machine. When the agent starts as a service, everything else is being reported correctly.
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

Not sure how this was missed, but the bug has been re-opened. The
issue surfaces with process metrics because the plugin was throwing
an exception when the process went away, rather than returning a data
point indicating the process was down. I updated the ticket with a
patch to fix:

http://jira.hyperic.com/browse/HHQ-427#action_14858

On Jan 31, 2007, at 12:13 PM, Todd Nine wrote:

> I have upgrade both my server and my agent to 2.7.7, however the
> service still does not show as stopped. I have attached the screen
> shot, take a look at the process named "Statements Java Process".
> You can see it still shows as running, and I can't get any metrics
> from it. I've waited 20 minutes after stopping it, but the status
> doesn't seem to update. It also shows as running if I restart the
> statement1 machine. When the agent starts as a service, everything
> else is being reported correctly.
>



Reply
0 Kudos
BC_hyperic
Enthusiast
Enthusiast

What about 3.0? Does the bug exist in 3.0? Does the same bug report cover 3.0 or is that a different bug report?
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee

The bug does exist in the beta, but will be fixed before GA. As far
as I know this only happens for plugins that thrown an exception
rather than returning a data point that the resource is unavailable.
These include the Process service and the Sun JVM 1.5, the other
plugins properly report unavailable rather than throwing an exception.

On Feb 2, 2007, at 4:57 PM, Bob Crothers wrote:

> What about 3.0? Does the bug exist in 3.0? Does the same bug report
> cover 3.0 or is that a different bug report?
>



Reply
0 Kudos