how to get exact objectname for jmx monitor

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
kfanselow
Posts: 241
Joined: Tue Aug 31, 2021 3:25 pm

Re: how to get exact objectname for jmx monitor

Post by kfanselow »

Hi sacom01,

Try changing to a single hyphen and no equal sign for username and password ( -username <user name> -password <password> ):

Change "--username xxxx--password xxxx" to " -username xxxx -password yyyy "

If that fails you might want to try quoting your username and password strings to ensure any special characters might be interpreted by the shell.

For example: -password 'b@dpa$$'

Please let us know how that goes.

Thanks and Best Regards,
Keith
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to get exact objectname for jmx monitor

Post by sacom01 »

hi,
[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=OperatingSystem" -A "MaxFileDescriptorCount" -w 100 -c 200 -username nagiosxi -password UnixTeam
JMX CRITICAL - No such attribute : MaxFileDescriptorCount

Change "--username xxxx--password xxxx" to " -username xxxx -password yyyy " --> did not work.

If that fails you might want to try quoting your username and password strings to ensure any special characters might be interpreted by the shell.
For example: -password 'b@dpa$$' --> no special characters in my password, i tried and success with the old check_jmx and jmxquery.jar i told you.
User avatar
kfanselow
Posts: 241
Joined: Tue Aug 31, 2021 3:25 pm

Re: how to get exact objectname for jmx monitor

Post by kfanselow »

Hi sacom01,

Just wanted to follow up - were you able to successfully query the Garbage Collector object you were working on previously ?

Thanks and Best Regards,
Keith
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to get exact objectname for jmx monitor

Post by sacom01 »

hi,
i tried query GC and the others but some of it was not success, as you told, jmx do not accept space in Object name but some objects do not contain space still not work. I just want ask how to determine exact objectname for jmx monitor as topic subject. :cry:

[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=OperatingSystem" -A "MaxFileDescriptorCount" -w 100 -c 200 --username xxx --password xxx
JMX CRITICAL - attributeName not found [MaxFileDescriptorCount]

[root@dc-nagiosxi-uat01 libexec]#
[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=OperatingSystem" -A "OpenFileDescriptorCount" -w 100 -c 200 --username xxx --password xxx
JMX CRITICAL - attributeName not found [OpenFileDescriptorCount]

[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=OperatingSystem" -A "ProcessCpuLoad" -w 100 -c 200 --username xxx --password xxx
JMX CRITICAL - ProcessCpuLoad = -1.0 | 'ProcessCpuLoad'=-1.0;100;200;;

[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=GarbageCollector,name=MarkSweepCompact" -A "CollectionCount" -w 100 -c 200 --username xxx --password xxx
JMX OK - CollectionCount = 3 | 'CollectionCount'=3;100;200;;

[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=GarbageCollector,name=ParNew" -A "CollectionCount" -w 100 -c 200 --username xxx --password xxx
JMX CRITICAL - objectName not found [java.lang:type=GarbageCollector,name=ParNew]
User avatar
kfanselow
Posts: 241
Joined: Tue Aug 31, 2021 3:25 pm

Re: how to get exact objectname for jmx monitor

Post by kfanselow »

Hi sacom01,

We're going to have to look further into the space in the object name problem to understand what is going on.

Thanks and Best Regards,
Keith
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to get exact objectname for jmx monitor

Post by sacom01 »

hi Keith,
as i sent you, some object names do not contain space but still not work.
example :
[root@dc-nagiosxi-uat01 libexec]# ./check_jmx -U service:jmx:rmi:///jndi/rmi://192.168.117.1:9002/jmxrmi -O "java.lang:type=GarbageCollector,name=ParNew" -A "CollectionCount" -w 100 -c 200 --username xxx --password xxx
JMX CRITICAL - objectName not found [java.lang:type=GarbageCollector,name=ParNew]

thank you.
User avatar
kfanselow
Posts: 241
Joined: Tue Aug 31, 2021 3:25 pm

Re: how to get exact objectname for jmx monitor

Post by kfanselow »

Hi sacom01,

Which version of the plugin are you using ? Are you using the original or are you using the updated version Greg recommended ? The updated version Greg recommended should handle spaces correctly -- it is derived from a version that contains the fix for the space issue.

https://code.google.com/archive/p/jmxquery/issues/16

Since we don't have access to your systems I think the best route at this point would be for you to work directly with the system's administrator if it is managed by someone else or open a ticket so we can get more information about it's configuration in confidence.

https://support.nagios.com/tickets/

Thanks and Best Regards,
Keith
sacom01
Posts: 194
Joined: Wed Dec 23, 2020 10:15 pm

Re: how to get exact objectname for jmx monitor

Post by sacom01 »

hi Keith,
"Which version of the plugin are you using" --> don't know but i have attached jmx for your check.

"The updated version Greg recommended should handle spaces correctly -- it is derived from a version that contains the fix for the space issue." --> i already tried and reply in this topic about new jmx, pls read again the topic from begining.
You do not have the required permissions to view the files attached to this post.
User avatar
kfanselow
Posts: 241
Joined: Tue Aug 31, 2021 3:25 pm

Re: how to get exact objectname for jmx monitor

Post by kfanselow »

Hi sacom01,

I see you submitted a ticket - Thank You. We will continue there and lock out this thread.

Thanks and best Regards,
Keith
Locked