Java Virtual Memory monitoring in Windows server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Java Virtual Memory monitoring in Windows server

Post 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?
Thanks & Regards,
I2MP Team.
User avatar
rexconsulting
Posts: 60
Joined: Fri May 04, 2012 4:27 pm
Location: Oakland, CA
Contact:

Re: Java Virtual Memory monitoring in Windows server

Post 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.
CP
--
Chris Paul
Rex Consulting, Inc
5652 Florence Terrace, Oakland, CA 94611
email: [email protected]
web: http://www.rexconsulting.net
phone, toll-free: +1 (888) 403-8996 ext 1
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Java Virtual Memory monitoring in Windows server

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Java Virtual Memory monitoring in Windows server

Post by cdienger »

@RIDS_I2MP, did the responses help resolve your issue?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Java Virtual Memory monitoring in Windows server

Post by RIDS_I2MP »

Hello,

I am still checking that, will update you as soon as its resolved.
Thanks for the help :)
Thanks & Regards,
I2MP Team.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Java Virtual Memory monitoring in Windows server

Post 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.
Thanks & Regards,
I2MP Team.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Java Virtual Memory monitoring in Windows server

Post 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.
Former Nagios employee
https://www.mcapra.com/
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Java Virtual Memory monitoring in Windows server

Post by cdienger »

Thanks again for your input, @mcapra!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Java Virtual Memory monitoring in Windows server

Post 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.
Thanks & Regards,
I2MP Team.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Java Virtual Memory monitoring in Windows server

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked