jboss
Monitoring JBoss AS start with JMX
Friday, September 3rd, 2010 | Java, Tech-savvy | 2 Comments
Today a fellow colleague asked for a better way to check whether an app server is really up and running than grepping the log file. Well, for we are using a JEE compliant server (JBoss) I suggested looking into JMX for it is the designated monitoring interface, right? Unfortunately I didn’t get replied to even after suggesting it twice. Whatever, apart from proving brilliant communication skills I may have missed something that didn’t make JMX an option (like a firewall issue or something).
Still, I wanted to look into it anyway, because it seemed a fun and pretty simple task to write a little JMX client that probes the desired MBean. But it is even easier. JBoss offers a little helper out of the box that is up to the task in no time. It’s a little tool called twiddle. Usage is self explanatory:
A JMX client to 'twiddle' with a remote JBoss server.
usage: twiddle [options] <command> [command_arguments]
options:
-h, --help Show this help message
--help-commands Show a list of commands
-H=<command> Show command specific help
-c=command.properties Specify the command.properties file to use
-D<name>[=<value>] Set a system property
-- Stop processing options
-s, --server=<url> The JNDI URL of the remote server
-a, --adapter=<name> The JNDI name of the RMI adapter to use
-u, --user=<name> Specify the username for authentication
-p, --password=<name> Specify the password for authentication
-q, --quiet Be somewhat more quiet |
Now you only have to decide which MBean to probe. As “are u there” is one of the most basic thinks to ask for this isn’t too hard either:
twiddle.sh get jboss.system:type=Server Started |
As soon as this returns true the server is up and running.
So, just put this command in your shell script and you can easily probe your JBoss AS if it is ready to go app serving.
Search
Categories
- (X)HTML/CSS (5)
- Activities (29)
- Gadgets (35)
- Insights (2)
- Java (22)
- Certification (1)
- IDE (10)
- JSP (1)
- Language (16)
- Quirks (9)
- Vocabulary (10)
- Linux (16)
- Misc (58)
- Photography (16)
- Reviews (69)
- Tech-savvy (81)
Tag Cloud
Archives
- May 2013 (3)
- April 2013 (1)
- March 2013 (1)
- February 2013 (1)
- January 2013 (1)
- December 2012 (3)
- November 2012 (1)
- October 2012 (3)
- September 2012 (3)
- July 2012 (1)
- May 2012 (1)
- April 2012 (1)
- February 2012 (7)
- January 2012 (1)
- December 2011 (2)
- November 2011 (4)
- October 2011 (5)
- September 2011 (3)
- August 2011 (3)
- July 2011 (2)
- June 2011 (4)
- May 2011 (1)
- April 2011 (2)
- March 2011 (2)
- February 2011 (2)
- January 2011 (6)
- December 2010 (2)
- November 2010 (5)
- October 2010 (7)
- September 2010 (13)
- August 2010 (6)
- July 2010 (4)
- June 2010 (3)
- May 2010 (3)
- April 2010 (2)
- March 2010 (2)
- February 2010 (1)
- January 2010 (1)
- December 2009 (1)
- November 2009 (2)
- October 2009 (5)
- September 2009 (1)
- August 2009 (3)
- July 2009 (5)
- June 2009 (5)
- May 2009 (6)
- April 2009 (3)
- March 2009 (3)
- February 2009 (2)
- January 2009 (1)
- December 2008 (9)
- November 2008 (15)
- October 2008 (15)
- September 2008 (13)