check_jmx4perl can't get to work under Nagios
Posted: Wed Jul 03, 2019 2:27 pm
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.
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.