Page 1 of 1
Java Virtual Memory monitoring in Windows server
Posted: Wed Aug 22, 2018 4:21 am
by RIDS_I2MP
Hello Team,
I want to monitor "Java Virtual Memory" in a windows server on which other parameters like CPU utilization, physical memory utilization, disk space usage, etc. are already being monitored.
Can you please let me know if it is possible?
Re: Java Virtual Memory monitoring in Windows server
Posted: Wed Aug 22, 2018 5:50 am
by rexconsulting
I've written a lot of custom checks using jmx, which can access pretty much anything in the jvm. The only downside is that it uses java, and it takes a bit more memory and CPU than most checks.
Re: Java Virtual Memory monitoring in Windows server
Posted: Wed Aug 22, 2018 8:12 am
by mcapra
The official JMX documentation specifically covers heap memory usage:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Though "virtual memory" is a bit vague in this case.
Re: Java Virtual Memory monitoring in Windows server
Posted: Wed Aug 22, 2018 2:16 pm
by cdienger
@RIDS_I2MP, did the responses help resolve your issue?
Re: Java Virtual Memory monitoring in Windows server
Posted: Thu Aug 23, 2018 1:41 am
by RIDS_I2MP
Hello,
I am still checking that, will update you as soon as its resolved.
Thanks for the help

Re: Java Virtual Memory monitoring in Windows server
Posted: Thu Aug 23, 2018 1:51 am
by RIDS_I2MP
Hello,
I checked the document provided here, but its for Linux server.
I want to monitor the java virtual memory on a Windows server. Can you please let me know the same for Windows server.
Re: Java Virtual Memory monitoring in Windows server
Posted: Thu Aug 23, 2018 8:26 am
by mcapra
I would suggest thoroughly reviewing the documentation. The only Linux specific part of that documentation is regarding the agent configuration. You could just as easily swap out NRPE for NSClient++ and use the exact same Nagios-side configurations. The only difference would be how you configure the check_jmx plugin/command client-side.
Here's a detailed guide for configuring custom plugins with NSClient++:
https://support.nagios.com/kb/article.php?id=528
One could also argue the check_jmx script is "Linux specific", but it's pretty dirt simple; It wraps args and feeds them into the jmxquery.jar file:
Code: Select all
#!/bin/sh
#
# Nagios plugin to monitor Java JMX (http://java.sun.com/jmx)attributes.
#
RDIR=`dirname $0`
$JAVA_HOME/bin/java -jar $RDIR/jmxquery.jar $@
It wouldn't take much to turn it into a "Windows" script. The Powershell equivalent might look something like this:
Code: Select all
$allArgs = $PsBoundParameters.Values + $args
Start-Process -FilePath java -ArgumentList '-jar Z:\path\to\jmxquery.jar $allArgs '
Or as a batch file:
Code: Select all
java -jar Z:\path\to\jmxquery.jar %*
Relative paths might make more sense and would allow jmxquery.jar and your check_jmx script to exist in the same place more seamlessly.
One thing I would like to emphasize on the first page of this documentation, because it is often missed, is that this plugin assumes your Java runtime has a running JMX server.
Re: Java Virtual Memory monitoring in Windows server
Posted: Thu Aug 23, 2018 2:03 pm
by cdienger
Thanks again for your input,
@mcapra!
Re: Java Virtual Memory monitoring in Windows server
Posted: Tue Sep 04, 2018 5:25 am
by RIDS_I2MP
Hello,
The owner of the Windows server is not willing to use the document related to unix/linux.
If possible, please help me with some document particularly for windows server.
Re: Java Virtual Memory monitoring in Windows server
Posted: Tue Sep 04, 2018 2:56 pm
by cdienger
We don't have a document like the one you're requesting, but as
@mcapra pointed out and demonstrated, the check can be converted to a Windows batch or powershell script easily. Once that is done you can use the steps in
https://support.nagios.com/kb/article.php?id=528 to execute it.