Translations of this page:

Osmius

Osmius agent for Tomcat
Agent name: osm_ag_TOMCAT01 Agent code: TOMCAT01
Subject: Tomcat Osmius agent User manual
Date: 09/12/2008 Revision date:

General Information

This agent can monitor several parameters of Apache-Tomcat. It has been tested hardly with a lot of Apache-Tomcat servers. However, we recommend checking its functionality before implanting it in a production environment.

Tomcat agent has been developed using functionalities and enhancements of Osmius framework and ACE libraries, so it is necessary to install the ACE libraries for the proper deployment and operation of Tomcat agent. See chapter: installation.

TOMCAT01 provides up to 9 basic events with configuration parameters to allow scaling of a very simple way.

All events are remote, so not intrusive. Monitoring is done through the network connection, by this reason you have to provide some connection information, see connection info for this agent. Events are based on JMX queries, so you need jre at least installed where agent will run.

Tomcat Instance

As a general rule each Osmius agent can monitor one instance type. If you are not familiar with these concepts check out the glossary. Each instance is individually defined in the configuration file (if you want further information go to agents and instances); depending on agent type is the instance type and depending on instance is the connection info.

CONNECTION_INFO

The connection information or connection_info is data that the agent needs to know to connect to the instance. (See more about the connection_info)

For Apache-Tomcat agent the connection_info prototype would be:

CONNECTION_INFO= -i TOMCAT_IP -p JMX_PORT

Replace the following:

  • TOMCAT_IP: Tomcat server IP address. Mandatory.
  • JMX_PORT: open port to perform JMX queries. Mandatory.

Examples:

CONECTION_INFO = -i 127.0.0.1 -p 1099
CONECTION_INFO = -i 192.168.3.241 -p 1099

TYPE

The type defines the instance type to be monitored. Every declared instance must be associated with a type as you can see here

For Apache-Tomcat:

TYPE= TOMCAT01

Event summary table for Tomcat

Here is briefly the capabilities of this agent, further down on this page each event is described in more detail.

EVENT DESCRIPTION c w a tseconds Extra parameters / Remarks
AVAILABL Tomcat availability 1 0 0 600 Silent mode ( -s) recommmended
TCUPTIME Uptime in seconds 1 900 300 600 None
TCAPPDEP Checks if an application is deployed 1 0 0 86400 -D “webapp1”
Silent mode ( -s) recommmended
TCAPPRUN Checks the running state of a list of webapps 0 1 1 300 -L “webapp1[,webapp2,webappN]”
Silent mode ( -s) recommmended
TCPRCMEM Memory use percentage 0 50 75 300 Silent mode ( -s) recommmended
TCPROCRS CPUs detected by JVM 1 1 1 172800 Silent mode ( -s) recommmended
TCLIVTHR Threads counter 0 100 200 600 Silent mode ( -s) recommmended
TCPENOBJ Pending objects counter 0 2 5 300 Silent mode ( -s) recommmended
TCTIMCPU Spent time in seconds executing Java 0 600 3600 86400 Silent mode ( -s) recommmended

Tomcat agent events

AVAILABL

AVAILABL event checks JMX connection to Tomcat server.
The meaning of this event is the availabilty of Tomcat server from the user side.

Return values:

VALUE MEANING
-1 Error
0 No connection
1 Connection OK

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold 0
Alert threshold 0

Parameter setting example:

AVAILABL = -t 600 -c 1 -w 0 -a 0 -T "Availabilty Tomcat server1"

Remarks: The event text will show connection status, operating system name and version and system architecture.

TCUPTIME

TCUPTIME event returns the time in seconds since last (re)boot.

Return values:

VALUE MEANING
-1 Error
N Uptime in seconds

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold 900
Alert threshold 300

Parameter setting example:

TCUPTIME = -t 600 -c 1 -w 900 -a 300 -T "Uptime Tomcat server1"

Remarks: The event text will show uptime in human readable format: Days [X] Hours[Y] Mins[Z] [IP:PORT]

TCAPPDEP

TCAPPDEP event checks if an application is deployed on Apache-Tomcat server.

Extra parameters:
This event need an extra parameter to work:

PARAMETER MEANING Mandatory
-D -D “webapp1” - Web application name to check if it is deployed.
You can find the name of applications at “Tomcat Manager” section.
Yes.

Return values:

VALUE MEANING
-1 Error
0 Not deployed
1 DEPLOYED

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 1 second – 1 week –> depends on instance importance
Warning threshold 0
Alert threshold 0

Parameter setting example:

TCAPPDEP = -t 86400 -c 1 -w 0 -a 0 -D "osmius" -T "Osmius deployment"

Remarks: None

TCAPPRUN

TCAPPRUN checks the running state of an application list.

Extra parameters:
This event need an extra parameter to work:

PARAMETER MEANING Mandatory
-L -L “webapp1[,webapp2,webappN]” - Web applications list to monitor. (Don't use blanks between ,)
You can find the name of applications at “Tomcat Manager” section
Yes.

Return values:

VALUE MEANING
-1 Error
0 All webapps are running
1 At least one webapp is stopped

Recommended parameters:

Comparison type Direct. The higher value the higher severity (-c 0)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold 1
Alert threshold 1

Parameter setting example:

TCAPPRUN = -t 300 -c 0 -w 1 -a 1 -L "osmius,webdav" -T "checking running status"

Remarks: The event text will show the name of first found stopped webapp.

TCPRCMEM

TCPRCMEM returns Tomcat server memory usage percentage.

Return values:

VALUE MEANING
-1 Error
0 - 100 % used memory

Recommended parameters:

Comparison type Direct. The higher value the higher severity (-c 0)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold 50 - Consult on administrator
Alert threshold 75 - Consult on administrator

Parameter setting example:

TCPRCMEM = -t 60 -c 0 -w 50 -a 75 -T "memory usage percentage"

Remarks: None

TCPROCRS

TCPROCRS returns number of processors detected by Java Virtual Machine.

Return values:

VALUE MEANING
-1 Error
N # CPU

Recommended parameters:

Comparison type Inverse. The lower value the higher severity (-c 1)
Monitoring interval 1 day – 1 week –> depends on instance importance
Warning threshold X - Consult on administrator
Alert threshold Y - Consult on administrator

Parameter setting example:

TCPROCRS = -t 172800 -c 1 -w 2 -a 1 -T "Number of processors detected"

Remarks: None

TCLIVTHR

TCLIVTHR returns number of live threads in Tomcat server.

Return values:

VALUE MEANING
-1 Error
N Live threads

Recommended parameters:

Comparison type Direct. The higher value the higher severity (-c 0)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold X - Consult on administrator
Alert threshold Y - Consult on administrator

Parameter setting example:

TCLIVTHR = -t 600 -c 0 -w 100 -a 200 -T "Live Threads"

Remarks: None

TCPENOBJ

TCPENOBJ event returns number of pending objects in Tomcat server.

Return values:

VALUE MEANING
-1 Error
N Number of pending objects

Recommended parameters:

Comparison type Direct. The higher value the higher severity (-c 0)
Monitoring interval 1 second – 1 hour –> depends on instance importance
Warning threshold X - Consult on administrator
Alert threshold Y - Consult on administrator

Parameter setting example:

TCPENOBJ = -t 600 -c 0 -w 2 -a 5 -T "Pending Objects"

Remarks: None

TCTIMCPU

TCTIMCPU event returns seconds spent in java execution.

Return values:

VALUE MEANING
-1 Error
N java execution seconds

Recommended parameters:

Comparison type Direct. The higher value the higher severity (-c 0)
Monitoring interval 1 second – 1 week –> depends on instance importance
Warning threshold X - Consult on administrator
Alert threshold Y - Consult on administrator

Parameter setting example:

TCTIMCPU = -t 86400 -c 0 -w 600 -a 3600 -T "seconds of CPU"

Remarks: If Tomcat is the only java application running in the system this event means Tomcat processor time.

Tomcat prerequisites

In order to compile, this agent requires a set of prerequisites, which are generic to compile any Osmius agent, you can see these prerequisites.

Tomcat Osmius agent can monitor a remote JMX able Tomcat server. Add the following to catalina.sh:

JAVA_HOME=/home/admin/java/jdk1.5.0_14 (<- check)
JRE_HOME=/home/admin/java/jdk1.5.0_14/jre (<- check)
CATALINA_OPTS="-Dcom.sun.management.jmxremote \
  -Dcom.sun.management.jmxremote.port=1099 \
  -Dcom.sun.management.jmxremote.ssl=false \
  -Dcom.sun.management.jmxremote.authenticate=false"

You have to install JDK if you want to compile OsmiusJMXClient.java to obtainn which will be called by Tomcat Osmius agent to get server data. Remind that if you are manually installing Osmius you have to copy OsmiusJMXClient.class to $OSM_ROOT/bin. Set environmental variables corretly:

export JAVA_HOME = .../jdk1.5.0_14 (<- check)
PATH = $JAVA_HOME/bin:"${PATH}"

Tomcat agent makefiles and compilation

  • Make Project Creator (MPC) is used by Osmius, so creating Makefiles is a trivial task. If you want to learn more about MPC and Osmius check out the section of Makefiles on Osmius.
  • For Tomcat Osmius agent you can generate Makefile in this way:

From the agent directory using console or terminal.

Linux:

$ACE_ROOT/bin/mpc.pl -type make osm_ag_tomcat.mpc

HP-UX / Solaris:

$ACE_ROOT/bin/mpc.pl -type gnuace osm_ag_tomcat.mpc

Windows and Visual C 8:

%ACE_ROOT%\bin\mpc.pl -type vc8 osm_ag_tomcat.mpc
  • Now that you have created the Makefile, agent compiling is extremely simple.

Linux:

make -f Makefile.Osm_Ag_Tomcat_Osmius

HP-UX:

gmake -f Makefile.Osm_Ag_Tomcat_Osmius

Windows:

Open Osm_Ag_Tomcat_Osmius.vcproj with Visual Studio.
Select Release in solution configuration
Press Rebuild to compile.

Binaries are automatically installed in the bin directory of OSM_ROOT base directory.

Running Tomcat agent

Tomcat Osmius agent have the same running features of the other Osmius agents. You can check it out int he section Start and Stop Agents.

To execute Tomcat Osmius agent without Osmius web console:

osm_ag_TOMCAT01[.exe]1) -c osm_ag_TOMCAT01.ini -m MASTERAG -p 1950 -d [>> osm_ag_tomcat01.log]2)

Running in standalone mode

Tomcat Osmius agent, like the others Osmius agents, allows the execution in standalone mode. This option may be particularly useful when developing a new agent or to perform specific agent tests.

Basically you have to add a new value, called SNDCMD, to Tomcat Osmius agent configuration file (osm_ag_TOMCAT01.ini) as shown here.

Then run Tomcat Osmius agent setting Master Agent communications port to zero, for example:

osm_ag_TOMCAT01[.exe] -c osm_ag_TOMCAT01.ini -m 00000000 -p 0 -d

Tests list

Test performed to Tomcat Osmius agent.

Date: 13/02/2008
Test Result Remarks
Creating an instance with all its events in silent mode OK N/A
Creating an instance with all its events with custom text OK N/A
Creating an instance with all its events but no custom text OK N/A
Declaration of 3 instances with all its events to 5 seconds and keep it
running for 48 hours
OK, minimum time for this instance is 5 seconds No memory leaks
Declare 2 instances, cause a disconnect and then reconnectOK Correct reconnection
Declare 1 instance and test each event OK N/A
Elimination of general parameter and check unbootable OK N/A
Elimination of instance CONN_INFO and check unbootable OK N/A
1) On Windows platforms add .exe extensions
2) Optional, to store agent messages in a file
 
en/agentes/tomcat01.txt · Last modified: 2012/12/05 19:15 by osmius
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki