rhuss / jmx4perl

JMX access tools and modules
http://search.cpan.org/~roland/jmx4perl/
Other
45 stars 12 forks source link

check_jmx4perl Errors if password has dollar sign at end #44

Open Graham42 opened 9 years ago

Graham42 commented 9 years ago

I have a nagios check that fails with:

UNKNOWN - Error: Unknown unit B for value 4294543104 at /usr/share/perl5/vendor_perl/JMX/Jmx4Perl/Nagios/SingleCheck.pm line 429.

Something to note, in the web interface it was saying B$ instead of just B.

I changed the password for the user and the check_worked, so it seems to be an issue with a password with a trailing dollar sign. Here's the check:

check_jmx4perl --url http://$HOSTADDRESS$:8080/jolokia --user=myuser --password=blahblah9$ --value java.lang:type=Memory/HeapMemoryUsage/used --base  java.lang:type=Memory/HeapMemoryUsage/max --critical :90 --unit=B

I also tried modifying the check to have single/double quotes around the password but still got the same error.

rhuss commented 9 years ago

I just setup the same authentication scheme but cannot reproduce the error:

$ check_jmx4perl --server tc --user=myuser --password=blahblah9$ --value java.lang:type=Memory/HeapMemoryUsage/used --base  java.lang:type=Memory/HeapMemoryUsage/max --critical :90 --unit=B
OK - [java.lang:type=Memory/HeapMemoryUsage/used] : In range 1.96% (71.35 MB / 3.56 GB) | [java.lang:type#Memory/HeapMemoryUsage/used]=74813432B;;:3436078694.4;0;3817865216

Could it be, that there is an issue with the Web interface you are using ? (Is it Thruk ?)