pandora fms: apache tomcat enterprise plugin

11
Pandora FMS Administrator Manual Apache Tomcat Plugin

Upload: artica-st

Post on 19-Jan-2015

301 views

Category:

Technology


24 download

DESCRIPTION

This is an Enterprise Plugin which allow you to monitor Tomcat web servers using mod_status. For more information visit the following webpage: http://pandorafms.com/index.php?sec=Library&sec2=repository&lng=en&action=view_PUI&id_PUI=275

TRANSCRIPT

Page 1: Pandora FMS: Apache Tomcat Enterprise Plugin

Pandora FMSAdministrator Manual

Apache Tomcat Plugin

Page 2: Pandora FMS: Apache Tomcat Enterprise Plugin

Administrator Manual Apache Tomcat Plugin

© Artica Soluciones Tecnológicas 2005­2012

Index1Changelog...........................................................................................................................................32Introduction........................................................................................................................................43Compatibility Matrix..........................................................................................................................54Documentation provided by the requesting area................................................................................65Modules avalible with Tomcat plugin................................................................................................76Using and plugin configuration..........................................................................................................8

6.1.Plugin Agent (local) ..................................................................................................................86.2.SNMP Monitoring...................................................................................................................106.3. JMX Monitoring.....................................................................................................................11

Page 3: Pandora FMS: Apache Tomcat Enterprise Plugin

1 CHANGELOG

Date Author Change Version

09/05/12 Tomas First Version v1r1

21/12/12 Tomas Bug fixed v1r2

14/01/12 Tomas Bug fixed v1r3

Page 3

Page 4: Pandora FMS: Apache Tomcat Enterprise Plugin

2 INTRODUCTION

Taking as an starting point that we have installed both Pandora and the Apache Tomcat server, we are going to explain how to get information about the status of the server and the applications that run on it.

There are different methods to reach our target, from using agent plugins for including the modules that monitor this information offered by web pages in the Pandora server, to the use of SNMP and programs that are dedicated to this objective, like JMX through jconsole:

Page 4

Page 5: Pandora FMS: Apache Tomcat Enterprise Plugin

3 COMPATIBILITY MATRIX

Systems where it has been tested • Tomcat 6.0.35

Systems where it should work • Tomcat 6.x and higher

Page 5

Page 6: Pandora FMS: Apache Tomcat Enterprise Plugin

4 DOCUMENTATION PROVIDED BY THE REQUESTING AREA

The documentation provided by the area which requests the monitoring services is:

• Username: username to authenticate into Tomcat

• Password: password to authenticate into Tomcat

• Tomcat server IP: IP address of Tomcat server which will be monitored.

Page 6

Page 7: Pandora FMS: Apache Tomcat Enterprise Plugin

5 MODULES AVALIBLE WITH TOMCAT PLUGIN

The modules returned by this plugin are:

• ConnectorName:JK_THREADS_BUSY

• ConnectorName:JK_THREAD_COUNT

• ConnectorName:JK_MAX_THREADS

• TOMCAT_FREE_MEM

• TOMCAT_MAX_MEM

• TOMCAT_TOTAL_MEM

Page 7

Page 8: Pandora FMS: Apache Tomcat Enterprise Plugin

6 USING AND PLUGIN CONFIGURATION

6.1. Plugin Agent (local) 

In this example we suppose that we have installed the Pandora server and the Tomcat server in 

different machines, with all the monitoring programs correctly installed  (Pandora Agent, JMX con 

jconsole)

We need an script that gets information from the XML page that contains the Apache Tomcat data 

In our case we use a Turnkey Apache Tomcat, in which that page is at:

http://<Tomcat-IP-Address>:<Port>/manager/status?XML=true

Note: by default Tomcat port is 8080

This script is going to store this page in a temporary file and is going to get the corresponding values for each data that we want to monitor and present it in an XML format ready to be introduced in Pandora.

The plugin only works with Tomcat servers with two or more connectors defined so its very important to define at least two connectors to ensure the plugin works properly.

/etc/tomcat<version>/server.xml

Page 8

Page 9: Pandora FMS: Apache Tomcat Enterprise Plugin

The script is the following:

pandora_tomcat.pl

Once that we have the script with the values that we want to monitor, we include it in the pandora_agent.conf  as an agent plugin. This plugin will introduce one module for each of these values, visible in the Pandora server web interface.

Note: It is very importan to change plugin file permissions to ensure the server can execute it.

Responding to the inclusion of new connectors in the Tomcat server, the program will answer adding new modules in a dynamic way with information about each new connector.

The Java connectors are APIs that gives an interface between one Java program and other applications or servers. Those connectors makes to show to the Java program the other server or application as an Enterprise JavaBean (EJB), providing compatibility between both of them.

This way, each module will be identified by connector name plus the kind of data that it collects.

/etc/pandora/pandora_agent.conf

module_plugin <ruta­plugin> ­­user=username ­–password=userpass http://<TomcatServer­IP­Address>:<Port>/manager/status?XML=true <plugin­name>

Page 9

Page 10: Pandora FMS: Apache Tomcat Enterprise Plugin

6.2. SNMP Monitoring

You can use one of the serveral SNMP­JMX adaptors to monitor Apache Tomcat.

Between them, the most important are:

– Westhawk SNMP

– Sun JDMK

Each one with their corresponding configurations allow us to convert the JMX notifications in SNMP 

Traps and extract the information about the server status.

Now, we only have to introduce the OIDs of the MIBs generated by the adaptor with their 

corresponding value and kind of data in the Pandora server, and it will be ready to be monitored.

Other way to monitor it is by using JMX.

Page 10

Page 11: Pandora FMS: Apache Tomcat Enterprise Plugin

6.3.  JMX Monitoring

JMX (Java Management Extensions) offers the tools to implement solutions that are distributed, 

modular, dynamic , and that are web base to manage and monitor devices, applications and 

networks controlled by services, specialized for Java .

JMX uses a HTTP adaptor to show the information that it manages in the web 

We can take advantage of the extraction that the HTTP adaptor gets form the data parsing the in an 

XML format that is compatible with Pandora.

Anyway, it is better to use the other two methods and leave the last option just as other choice.

There is an easier way to monitor the Tomcat server using JMX, if we use the  twiddle command, a 

JMX client that works collecting the different data from the server Mbeans, in a format  <name­

data>=<data> once it is executed. With it we can collect informtation of the Mbeans features that 

contains the information about the status of the system and the connectors.

Page 11