Better HTTP monitoring plugin?

Elias Ross genman at noderunner.net
Wed Aug 31 20:56:45 UTC 2011


I put together an HTTP monitoring plugin. Mostly because I didn't
realize "NetServices" had support for HTTP already. (More on this in a
bit.)

Anyway, my purpose was to create something that could pull
measurements/metrics from a web page. I thought I could with the
script plugin, but seemed like a bit of hack. The plugin is not
necessarily something for monitoring a page, but it does do that too.

For example, if you had a page like:

http://localhost:8080/myapp/stats.jsp:

Number of purchases: 52
Time to process: 21.21
Errors: 4

You could graph that stuff in RHQ. If you extend the plugin, your
config would appear like:

      <plugin-configuration>
         <c:simple-property name="url" required="true"
default="http://localhost:8080/myapp/stats.jsp" ...
...
      <metric property="purchases: (\d+)" dataType="measurement"
displayName="purchases" ...

Like the script plugin it extracts metrics from a regex. It's a little
more straightforward as you don't pass arguments to the page, you just
expect the page to contain all the metrics you need.

Also as a plugin, it can also "auto discover", similar to users who
extend the JMX plugin with a specific MBean, web pages that are served
locally. So you don't need to manually add it. It will do an "HTTP
GET" and add itself.

There are some quirks with it and the display data may need to be
tweaked. I don't know how to name it. I call it 'HTTPServer' but it's
really not a *server*, more like a HTTP page monitor.

Another nice thing is my Plugin has a comprehensive unit test suite.
So all the features are tested, at least as well as I can outside RHQ.

I don't really know what to do with it. I may just move the features
to NetService's HTTP plugin, including tests. But only if there's some
more interest. Or it may be wise to keep the existing plugin as-is and
just create one that's 'newer.'


More information about the rhq-devel mailing list