Collecting Java Heap memory usage on Windows 2012 R2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
alsoszaa
Posts: 33
Joined: Fri Sep 21, 2018 10:52 am

Collecting Java Heap memory usage on Windows 2012 R2

Post by alsoszaa »

Is there a way to monitor Java Heap (Total memory) from Tomcat on a Windows server? I think the plugins for Java on Nagios Exchange are for Linux distributions:

Java JDK 1.8.0_112
Tomcat 8.5
Windows 2012 R2

Looking for a way to collect the heap memory usage and set a warning and critical value.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Collecting Java Heap memory usage on Windows 2012 R2

Post by mcapra »

The way practically any Java runtime is monitored is via JMX, either remotely via JMX clients connecting to JMX servers or locally via some tool like jconsole.

Here's the official documentation for monitoring Java runtimes via JMX with Nagios:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

The only tricky part is this particular prerequisite:
This document assumes you have the following:
  • A remote server running JMX
Which is something most Tomcat admins should be familiar with and able to provide insights on. Else, there's boatloads of guides out there for getting your Tomcat server setup with a JMX server:
https://wiki.scn.sap.com/wiki/pages/vie ... =439649886
https://tomcat.apache.org/tomcat-7.0-do ... oring.html

Depending on how Tomcat was configured, you may also have some Tomcat specific Windows performance counters (like heap usage) being exposed which can be monitored by Nagios XI via an agent NSClient++ , NCPA, or WMI:
https://support.nagios.com/kb/article.php?id=127

Happy to answer questions if you have any!
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Collecting Java Heap memory usage on Windows 2012 R2

Post by cdienger »

Thanks for the input, @mcapra! Valuable info as usual.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked