tags:

views:

123

answers:

2

I've built a simple alert monitor to display the health of various applications. This is configured by XML, as each monitor instance needs to show different metrics. An example configuration may be:

<machine>
  <monitors>
    <check type="connectivity" name="Production Server">
      <property key="host" value="ops01.corp" />
      <alarm />
    </check>
  </monitors>
</machine>

Currently, I'm storing this in the root of the C:\ drive of the server. What would be nice is if I could put it in the deploy directory of the JBoss server, and could somehow get a reference to it. Is this possible? I looked at MBeans but it didn't seem to support complex XML structures.

Robert

+2  A: 

You can get an input stream for any file in the classpath by using the ClassLoader#getResourceAsStream(String name) method. Just pass the location of the file relative to the classpath.

Pascal Thivent
+2  A: 

Try JOPR - http://www.jboss.org/jopr .

For custom metrics, you can write your own plug-in.

Ondra Žižka