(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.