I would recommend it instead of rolling your own. They've even got a MBean for managing restarts, etc.
I'll be glad to contribute / patch our jboss startup/shutdown wrapper around ServerImpl that controls the service manager lifecycle if it would help.
Jeff
Ivelin Ivanov wrote:
Very nice, Bill.
Email notifications when memoty is low will be very
useful.
Is there a CPU utilization monitor as well?
Scott and I talked some time ago about a heart watch service which will restart the server when the memory is too low or the CPU is pegged for too long.
Your work will be of help.
Do you have some thoughts what is an appropriate way to restart the server. Not restart the JVM, but just undeploy everything and deploy it again.
Ivelin
--- Jae Gangemi <[EMAIL PROTECTED]> wrote:
agreed - i can't wait to start playing w/ it.[mailto:[EMAIL PROTECTED]
any proposed ETA for 3.2.4?
-jae
-----Original Message----- From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]On Behalf Of Ben Sabrin Sent: Tuesday, January 06, 2004 3:00 PM To: [EMAIL PROTECTED] Subject: RE: [JBoss-dev] New JBoss Monitoring services
Well done Bill, this is good stuff:)
-----Original Message----- From: [EMAIL PROTECTED]
name="ObservedObject">jboss.system:type=ServerInfo</attribute>On Behalf Of Bill Burke Sent: Friday, December 12, 2003 4:24 PM To: Jboss-Dev; JBoss 2; [EMAIL PROTECTED] Subject: [JBoss-dev] New JBoss Monitoring services
This will be released in JBoss 3.2.4, but it is now
available in 3.2 branch: cvs checkout -r Branch_3_2 jboss-3.2
I've also attached some screen shots
JBoss Monitoring
In JBoss 3.2.4, we've implemented some new JMX MBean
monitoring and a nice GUI around this infrastructure as well as a way
to plug in how alerts are processed. Why didn't we use the JMX
Gauge and String monitors that come implemented with the JMX spec? 3
reasons:
1. They are not integrated with our Service architecture 2. They have no way of determining which monitors have sent an alert and are currently disabled because an alert was reached 3. They have no way of reseting an alert
So, what infrastructure have we built? First let's
look at configuring a JMX MBean monitor through the plain old
-service.xml interface that you would to create any MBean.
All Monitors are MBeans that start a thread to watch
the values of another MBean's attribute. When a monitoring
threshold is reached, the MOnitor will send out an MBean Notification to a set
of registered listeners. Currently in JBoss, the are two types of
listeners, a dumb Console listener, and an Email listener which will
send out an email whenever an alert is received. Of course, the
messages are fully configurable.
Numeric Attribute Monitors
The first type of monitor is a
org.jboss.monitor.ThresholdMonitor that is used to track Numberic MBean attributes. Here is
an example configuration of a monitor of free available memory.
It will send a JMX
Notification when free memory goes below one
megabyte. The MBean it is watching over that has this particular stat is
jboss.system:type=ServerInfo.
File: FreeMemory_Monitor-service.xml
<?xml version="1.0" encoding="UTF-8"?> <server> <mbean code="org.jboss.monitor.ThresholdMonitor" name="jboss.monitor:service=FreeMemory"> <attribute name="MonitorName">FreeMemory Monitor</attribute> <attribute
<depends-list-element>jboss.alerts:service=ConsoleAlertListener</depends<attribute name="ObservedAttribute">FreeMemory</attribute> <attribute name="Threshold">1000000</attribute> <attribute name="CompareTo">1</attribute> <attribute name="Period">1000</attribute> <attribute name="Enabled">true</attribute> <depends-list optional-attribute-name="AlertListeners">
-list-element><depends-list-element>jboss.alerts:service=EmailAlertListener</depends-l
name="ObservedObject">jboss.system:type=ServerInfo</attribute>ist-element> </depends-list> </mbean> </server>
Let's walk through each attribute:
<attribute name="MonitorName">FreeMemory</attribute>
The display name in which this monitor will be shown in the web-console.
If you create monitors by hand you can have it
managed by the web-console if you have one monitor defined in one
file only and the name of the file is the same name as the monitor and
the file lives in ./deploy/management/monitors/ So The above example
the filename should be FreeMemory_Monitor-service.xml, notice that
whitespace is substituted
with an '_' charater.
<attribute
<depends-list-element>jboss.alerts:service=ConsoleAlertListener</depends<attribute name="ObservedAttribute">FreeMemory</attribute>
These are the MBean and the MBean attribute this monitor will watch. If
the MBean is a ServiceMBean then you should make
this a <depends optional-attribute> so that this monitor doesn't
start before the
watched MBean is loaded.
<attribute name="Threshold">1000000</attribute> <attribute name="CompareTo">1</attribute>
The Threshold is the value threshold of the attribute. The CompareTo is
a numeric value, -1 means > (greater than), 0 means
= (equal), 1 means (less than). These are the same values used by Java
comparators. So in
this example, when the FreeMemory attribute is less
than 1000000 a JMX notification will be sent.
<attribute name="Period">1000</attribute>
The MBean creates a thread that will wake up every so often to check the
threshold against the MBean attribute it is watching. The Period is the
time in milliseconds this thread will sleep.
<attribute name="Enabled">true</attribute>
Enabled determines whether or not this monitor
should actually monitor. It is the on/off switch of the monitor.
<depends-list optional-attribute-name="AlertListeners">
-list-element><depends-list-element>jboss.alerts:service=EmailAlertListener</depends-l
=== message truncated ===ist-element> </depends-list>
When the threshold is triggered, the Monitor will send JMX NOtification
to all registered listeners. For this particular MOnitor, a Console and
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development
------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development