Long ago, a power elven mage Hatane Baequispear lost a one-sided war with the regional mage’s guild. When he was eventually captured and executed for his supposed crimes, he left his tower behind. Frustrated that the tower was empty, the guild had it torn down. They did not realize that the tower was simply a door to his true sanctum.

Recently, the long-lost vault of Hatane has been uncovered in town. A newly dug well struck an unusual stone structure 50 feet below ground. Excavation continued until a sealed door was located. The seal was broken, and a few brave men were sent in to investigate. They never returned, and the local constable ordered the door sealed again.

Professor Davic Ferill, the scholar who identified the vault as Hatane’s claims his lost writings might contain valuable information about the city’s history and prove or disprove his innocence. The local constable wants nothing to do with it, saying he can’t spare the men and it’s far too dangerous.

This is where you come in. A reward of 1000 gold has been set out to whoever can safely deliver the scholar Professor Ferill to Haatanae’s inner sanctum. No one knows how deep the vault is, or what dangers await; all that is known is that Hatane was convicted of crimes against nature.

And now for the shitty part- in the host.xml, you need to add a system property for each server, explicitly setting the snmp port you want to use- you can’t just use the port offset or a variable value because eap is not technically “managing that” according to redhat. Note that the port number has to be different for each worker on the same box.

And for a finishing touch, Lets configure pnp4nagios. Since the JVM stupidly returns these values as counters rather than gauges, we need to force pnp4nagios to use them as gauges.
In /etc/pnp4nagios/check_commands/check_tomcat_memory.cfg:

CUSTOM_TEMPLATE = 0
DATATYPE = GAUGE
RRD_STORAGE_TYPE = SINGLE

In /etc/pnp4nagios/check_commands/check_tomcat_threads.cfg:

CUSTOM_TEMPLATE = 0
DATATYPE = GAUGE
RRD_STORAGE_TYPE = SINGLE

And then you can use this as a template in /etc/pnp4nagios/templates/check_tomcat_memory.php: