Page 1 of 1

how to fetch JMX counters present on windows machine

Posted: Wed Jul 18, 2018 1:25 am
by kasim
Hi Team,
Thanks in advance.

1. how to fetch JMX counters present on windows machine using nagios xi. ?
I have Windows machine with my application and i want to fetch the JMX counter of my application using nagios. how can i do that ?
I observed the nagios provided the following documentation to fetch JMX on linux machine with agent :https://assets.nagios.com/downloads/nag ... 1530157277.

2. Can we fatch JMX counter without agent ?

Re: how to fetch JMX counters present on windows machine

Posted: Wed Jul 18, 2018 7:52 am
by mcapra
kasim wrote:1. how to fetch JMX counters present on windows machine using nagios xi. ?
The document you referenced covers the basics.

The only "Linux" requirement in that document is to use NRPE to execute the check_jmx plugin. There's nothing stopping you from re-writing the check_jmx plugin to work on Windows and loading it into NCPA or NSClient++. It's pretty simple:

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's really just a wrapper script that passes arguments to jmxquery.jar. jmxquery.jar doesn't care if it's executed via NRPE, NCPA, NSClient++, RPC, etc; It just needs a valid Java runtime.
kasim wrote:2. Can we fatch JMX counter without agent ?
You could alter the app's JMX configuration to be available to a range of IPs, or all IPs, or just your Nagios machine. This can all be done via the runtime's system properties.

Once the JMX connection is available to your Nagios machine, you could simple execute check_jmx, as described in the documentation, from the Nagios machine replacing "localhost" with the remote machine's address.

Re: how to fetch JMX counters present on windows machine

Posted: Wed Jul 18, 2018 9:38 am
by tmcdonald
Thanks for the assist, @mcapra! OP, please let us know if you need further assistance.