check_jmx Decimal Places

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ckiernan
Posts: 31
Joined: Fri Mar 11, 2016 5:17 pm

check_jmx Decimal Places

Post by ckiernan »

I've been using check_jmx to monitor Kafka successfully but just noticed that it only returns whole numbers. This just became a problem for me. We have some metrics that are typically between 0 and 1 (e.g. .80172). I'd like to be able to graph these decimals. I've searched and can't find any topic on this.

Thanks,

Chris
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_jmx Decimal Places

Post by mcapra »

This would likely involve some modifications to how jmxquery.jar works. Can you share the current check you're using executed from the CLI as well as its output?
Former Nagios employee
https://www.mcapra.com/
ckiernan
Posts: 31
Joined: Fri Mar 11, 2016 5:17 pm

Re: check_jmx Decimal Places

Post by ckiernan »

./check_jmx -U service:jmx:rmi:///jndi/rmi://<ip>:9999/jmxrmi -O kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent -A MeanRate -vvvv -w 50 -c 100
JMX OK MeanRate=0 | MeanRate=0

The actual value when viewed through jconsole at the same time is 0.97801
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_jmx Decimal Places

Post by mcapra »

Try replacing your jmxquery.jar and check_jmx with this updated one:
https://github.com/WillPlatnick/jmxquery/

It's receiving the checkData as an Object rather than a long, which I think should fix the problem. It also uses the compare function when assessing thresholds, which I think should resolve doubles (-w 0.5 -c 0.9) correctly.

Let us know if that doesn't work.
Former Nagios employee
https://www.mcapra.com/
ckiernan
Posts: 31
Joined: Fri Mar 11, 2016 5:17 pm

Re: check_jmx Decimal Places

Post by ckiernan »

This worked great with one exception. For some reason the Heap Memory performance graph stopped updating. I don't care about decimals there so I switched that one back to the old check_jmx. The rest of my 45 JMX checks are working fine.

Thanks for your help.

Chris
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_jmx Decimal Places

Post by cdienger »

Thanks for the update. Are we good to lock this one up then or did you have any additional questions?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ckiernan
Posts: 31
Joined: Fri Mar 11, 2016 5:17 pm

Re: check_jmx Decimal Places

Post by ckiernan »

I'm good. Please close.
Locked