how to fetch JMX counters present on windows machine

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kasim
Posts: 1
Joined: Wed Jul 18, 2018 1:14 am

how to fetch JMX counters present on windows machine

Post 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 ?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: how to fetch JMX counters present on windows machine

Post 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.
Former Nagios employee
https://www.mcapra.com/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: how to fetch JMX counters present on windows machine

Post by tmcdonald »

Thanks for the assist, @mcapra! OP, please let us know if you need further assistance.
Former Nagios employee
Locked