You are here

Unexpected response from check_jmx

2 posts / 0 new
Last post
j.j.d.e.lammerts's picture
Unexpected response from check_jmx

Syntax used : ./check_jmx -U service:jmx:rmi:///jndi/rmi:// -O 'org.hornetq:module=Core,type=Queue,address="jms.queue.abs.PublicService.DLQ",name="jms.queue.abs.PublicService.DLQ"' -A MessageCount -vvvv -w 1 -c 1 Result: JMX CRITICAL MessageCount=0 However, when I change the warning and critical parameters to 1 resp. 2 (NOT what I want), making the command look like this: ./check_jmx -U service:jmx:rmi:///jndi/rmi:// -O 'org.hornetq:module=Core,type=Queue,address="jms.queue.abs.PublicService.DLQ",name="jms.queue.abs.PublicService.DLQ"' -A MessageCount -vvvv -w 1 -c 2 The result is as it should be: JMX OK MessageCount=0 Any number for warning and critical, as long as they are the same, yields a wrong result (w=5, c=5): JMX CRITICAL MessageCount=0 Anyone here who can tell me why check_jmx (jmxquery.jar) decides that the result must be critical when w and c variables are equal ? Thank you, Hans

rjb95c's picture
Tried alternative versions?

Hi Hans,

Looking at the source code for the version of jmxquery on Google Code there doesn't seem to be an obvious issue with the threshold comparisons in that version. 

I even wrote an extra unit test case which passes as expected:

    @Test(description = "Test reading a simple numeric attribute with thresholds.")
    public void testThresholdsOnSimpleAttribute() throws Exception {
        runCommand("-U service:jmx:some:// -O foo:bar=x -A baz -w 1 -c 1");
        assertResponseWas(0, "JMX OK - baz=0 | baz=0");

If you've still got the issue then maybe it's worth trying that version of jmxquery (or alternatively JNRPE).