Upload
artica-st
View
226
Download
3
Embed Size (px)
DESCRIPTION
With this plugin you can monitor JBoss using JMX and Twiddle by using a Pandora FMS Agent Plugin, for Linux/Unix. For more information visit the following link:
Citation preview
Monitoring
JBoss
Page 1
Monitoring JBoss
OpenOffice/PDF Version
1º Edition , 9 May 2011
© Artica Soluciones Tecnológicas 2011
© Tomás Palacios Bote 2011
© Sancho Lerena 2011
Page 2
1 MONITORING JBOSS
1.1. Monitoring via plugins and modules
Once we have installed and configured both Pandora and JBoss servers, we're going to explain how to obtain info about the server status.
There are different ways to achieve this goal, from plugin agents for XML parsing to SNMP and JMX monitoring:
1.1.1. Plugin Agent (local way)
Let's suppose we have installed Pandora and JBoss servers on different machines, with all the monitoring systems installed and configured. (Pandora Agent, JMX with jconsole)
We need a script to gather the values we want to monitor from the MBeans in the JBoss server, specially the ones which contain information about the server status in their attributes.
We've used a Bitnami Jboss 6.0.0-0 virtual machine in openSUSE 11.3 to test this plugin and we can find JMX webpage in:
http://<JBoss-IP-Address>/jmx-console/
Page 3
This script is going to store these MBeans content file in a local temporal file and parse these values in a Pandora-compatible XML format.
We've based the development of this plugin in the twiddle script for JBoss.
Twiddle is a JMB client which gathers all kind of info about the server MBeans, into a <dataname>=<data> format after its execution.
The script is the following:
pandora_tomcat.pl
Once we have located the script and the values we want to monitor, include this file in pandora_agent.conf as a plugin agent. This plugin will create a module for each value, visible in the Pandora server web interface.
pandora_agent.conf is the configuration file of the Pandora Agent Software, and where all plugin agents must be located. This file can be found in:
/etc/pandora/pandora_agent.conf
We will write the following inside this file to create the plugin agent for Pandora:
module_plugin <plugin-path>
Restart Pandora Agent and the Pandora Server will create a module for each data contained in the
Apache server-status page, from current requests to CPU load and ratios.
/etc/init.d/pandora_agent_daemon restart
IMPORTANT: Twiddle only can be executed with root privileges in this virtual machine, so in
order to make the script work in Pandora, we need to run pandora agent as root or configure
twiddle to run under other non-privileged user.
Another option is to configure a normal user to run under SUDO commando. To do that, edit the
file /etc/sudoers with the visudo command as root (DO NOT edit this file using vim /etc/sudoers)
and include de following line:
pandora ALL= NOPASSWD: ALL
This way, Pandora can execute any commands using sudo without authentication.
module_plugin sudo <plugin-path>
Page 4
That's why in pandora_agent.conf, in module_plugin, the command is preceded by sudo.
1.1.2. SNMP Monitoring
You can use one of the multiple SNMP-JMX adaptors in the web to monitor JBoss.
These are the most important:
– OpenNMS
– Westhawk SNMP
– Sun JDMK
Each of them allows us to convert JMX notifications into SNMP Traps and extract information
about the server status.
It would be just a matter of introducing the OIDs of the generated MIBs by the adaptor with its
value and data type in the Pandora server and we could start monitoring it.
Page 5
Another way to monitor JBoss and other Java servers is JMX.
1.1.3. JMX Monitoring
JMX (Java Management Extensions) provides the tools to implement distributed, modular, dynamic
and web based solutions to manage and monitor, devices, applications and network-driven
services, specially designed for Java.
JMX uses an HTTP-adaptor to show all the info it manages via web.
We can take benefit of the HTTP-adaptor data extraction by parsing this data in a Pandora-
compatible XML format. When Pandora processes this XML, it will create modules for each data.
However, it's better to use the other two ways for JBoss monitoring and leave this as an
alternative.
Page 6