check_jmx4perl can't get to work under Nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

check_jmx4perl can't get to work under Nagios

Post by gmills »

Hello, I am trying to monitor JBoss Fuse OSGI Karaf Containers using the jmx4perl/check_jmx4perl script.

It works standalone on command line
check_jmx4perl --user=passthru --password=B@dC0mpany --url http://localhost:9090/jolokia --mbean java.lang:type=Memory --attribute HeapMemoryUsage --path max --base java.lang:type=Memory/NonHeapMemoryUsage/max
OK - [java.lang:type=Memory,HeapMemoryUsage,max] : In range -95472844799.99% (954728448 / -1) | [java.lang:type#Memory,HeapMemoryUsage,max]=954728448;;;0;-1

however in Nagios it fails
SERVICE NOTIFICATION: nagiosadmin;localhost;PassThru Container Heap Memory Usage;UNKNOWN;notify-service-by-email;UNKNOWNError: 403 Error while fetching http://localhost:9090/hawtio/jolokia/ :

Command Using $USER1$ because I have check_jmx4perl under /usr/local/nagios/libexec
define command{
command_name check_container_heap_memory_usage
command_line $USER1$/check_jmx4perl --user $ARG1$ --password $ARG2$ --url $ARG3$ --mbean $ARG4$ --attribute $ARG5$ --path $ARG6$ --base $ARG7$ $ARG8$
}

Service
define service{
use local-service
host_name localhost
service_description PassThru Container Heap Memory Usage
check_command check_container_heap_memory_usage!passthru!B\@dC0mpany!http://localhost:9090/hawtio/jolokia!ja ... !--warning 80 --critical 90

I'm escaping the password, do I need to do this? either way it doesn't work
I'm not sure where to go, it looks good configuration to me????
thank you so much for your help.
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: check_jmx4perl can't get to work under Nagios

Post by gmills »

thanks!!!

I found my error.

it was in the URL, removing hawtio worked.

http://localhost:9090/jolokia
gmills
Posts: 114
Joined: Wed Jun 12, 2019 2:08 pm

Re: check_jmx4perl can't get to work under Nagios

Post by gmills »

Please close this ticket request and thank you!!!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: check_jmx4perl can't get to work under Nagios

Post by benjaminsmith »

Please close this ticket request and thank you!!!
@gmills Thanks for the update. Happy to hear you got it resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked