Tomcat monitoring

Tomcat monitoring provides the following things:

  • access to tomcat-specific JMX metrics - thread pools, request processors, JSPs, servlets etc.

  • standard metrics provided by Zorka instrumentation - HTTP, SQL, LDAP etc. (in some cases adequate scripts need to be loaded and configured);

  • tracing for certain types of requests: HTTP, SQL etc.;

  • audit log for applications that use authentication and authorization features of Tomcat;

  • zabbix templates for (most of) above features: both common features and tomcat mbeans have some ready to use templates;

Agent installation

In order to install zorka agent on Tomcat:

  • unpack zorka binary distribution in tomcat directory and (optionally) rename unpacked directory to zorka;

  • edit zorka.properties file and load proper scripts:

 scripts = jvm.bsh, zabbix.bsh, apache/tomcat.bsh
  • edit <server-home>/bin/catalina.conf and add the following line at the end:
 CATALINA_OPTS="$CATALINA_OPTS -javaagent:<zorka-home>/agent.jar=<zorka-home>"
  • adjust other settings in zorka.properties if necessary (log files, listen port number etc.);

  • for JDK7 add zorka.spy.compute.frames = yes to zorka.properties or -XX:-UseSplitVerifier to JVM startup options;

  • for JDK8 add zorka.spy.compute.frames = yes to zorka.properties;

Configuration settings

Tomcat monitoring script implements standard HTTP monitoring, so standard options for HTTP do apply. Also, consider SQL and/or LDAP monitoring if your application uses SQL database(s) and/or LDAP. Scripts for frameworks and libraries, eg. Spring should also be considered. There are no specific settings for Tomcat.

Audit logs

Zorka agent supports auditing for authentication and authorization mechanisms built into Tomcat. It is disabled by default and uses standard configuration settings for audit as described in Application Auditing section. If application uses framework-specific authentication, appropriate scripts supporting those frameworks should be used.

Tracing tomcat

By adding tracer = yes to zorka.properties. HTTP requests are supported out of the box. Tracing of LDAP, SQL will be enabled automatically as soon as proper configuration scripts will be loaded and tracer = yes option is present. Additional scripts for applications, frameworks etc. can add their own types of traces that will be collected.

Depending on application and libraries it uses, additions tracer tuning might be necessary.

Zabbix templates

The following templates monitor tomcat-specific statistics:

  • Template_Zorka_Tomcat_JSP.xml - lists and monitors JSP pages via standard JMX beans exposed by Tomcat; this templates uses Zabbix 2.0 discovery feature to list deployed JSP pages;

  • Template_Zorka_Tomcat_RequestProcessors.xml - lists and monitors AJP/HTTP traffic seen at Tomcat request processors; this template uses Zabbix 2.0 discovery feature to list request processors;

  • Template_Zorka_Tomcat_Servlets.xml - lists and monitors servlets activity; this template uses Zabbix 2.0 discovery feature to list available servlets;

  • Template_Zorka_Tomcat_ThreadPools.xml - lists and monitors thread pools processing requests; this template uses Zabbix 2.0 discovery feature;

In addition some generic templates can be used:

  • Template_Zorka_Audit.xml - if auditing is enabled;

  • Template_Zorka_HTTP.xml - HTTP request handling statistics;

  • Template_Zorka_LDAP.xml - statistics for LDAP queries (if ldap.bsh is loaded);

  • Template_Zorka_SQL.xml - statistics for SQL queries (if some JDBC monitoring script is loaded);