Monitoring java memory-usage with Check_MK

Submitted by HighKing on Mon, 08/18/2014 - 16:29

After running out of memory with a Java application, I wanted to monitor the internal Java memory usage.

It cost me quite some time trying to get the information I seeked from JMX, still have not figured that out. Suddenly I ran into a simple Nagios-plugin that utilizes the jstat-command to just get the heap- and permgen usage from a java-process. The original plugin can be found here:

I have converted the plugin for use in Check_MK, see my version here:

Just place this one in /usr/lib/check_mk/local and create a configuration file /etc/check_mk/jstat.conf with the name of the service you'd like to check and the pidfile. So, if you'd like to monitor Tomcat, you could place something like this in the configuration file:

Tomcat /var/run/