Page 1 of 1

apache tomcat wizard

Posted: Fri Aug 11, 2023 8:39 am
by dslaughter
NagiosXI 15.10.0
Linux Centos7 64bit
Manual build
using ssl, no other special configuration

I'm trying to use the tomcat wizard using ncpa. Here is my check showing parameters.

[nagios@dean-nagiosxi ~]$ /usr/local/nagios/libexec/check_ncpa.py -H 192.168.89.45 -t YvBoFJFUH2BIKEOM -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:rmi:///jndi/rmi://localhost:8008/jmxrm,args=-t tomcat,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"
UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxrm

Here is the jvm application to monitor's startup.

/opt/jdk1.8/bin/java
-Djava.awt.headless=true
-Djava.security.egd=file:/dev/./urandom
-Dactivemq.store.dir=/opt/tomcat/activemq-data
-DJBILLING_HOME=/opt/jbilling
-Xms512M
-Xmx1024M
-server
-XX:+UseParallelGC
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8008
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=localhost
-classpath /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
-Dcatalina.base=/opt/tomcat
-Dcatalina.home=/opt/tomcat
-Djava.io.tmpdir=/opt/tomcat/temp
-Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start

I've been searching for a while and cannot find a solution. I can send system profile in direct message. Please advise...

Re: apache tomcat wizard

Posted: Mon Aug 14, 2023 11:20 am
by swolf
Hi @dslaughter, thanks for reaching out.

From looking at your command, it looks like the wrong Service URL was generated. In the argument to -s, you have

Code: Select all

service:jmx:rmi:///jndi/rmi://localhost:8008/jmxrm
I would recommend changing it to

Code: Select all

service:jmx:rmi:///jndi/rmi://localhost:8008/jmxrmi
Please let me know if that helps, or if you get a new error.

-Sebastian Wolf

Re: apache tomcat wizard

Posted: Tue Aug 15, 2023 7:10 am
by dslaughter
Updating the link did improve the check but still getting an error. Here is the output

[nagios@dean-nagiosxi ~]$ /usr/local/nagios/libexec/check_ncpa.py -H 192.168.89.45 -t YvBoFJFUH2BIKEOM -P 5693 -M plugins/check_jvm.jar -q "args=-s service:jmx:rmi:///jndi/rmi://regr-jbv4-45.tango-networks.com:8008/jmxrmi,args=-t tomcat,args=-C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime',args=-w '17179869184,34359738368,50,70,1500000:',args=-c '32212254720,68719476736,70,90,300000:'"
UNKNOWN: Invalid Check Type 'memorysimpleheap

Thank you for your help.

Re: apache tomcat wizard

Posted: Wed Aug 16, 2023 6:36 am
by dslaughter
The check is actually working. If I run from command line or is run by nagiosxi poller it works but if I try in 'run check command' in core config manager it fails.I guess it doesn't escape correctly. Since this is working you can close this issue. it would be great if the run check command could be fixed to work with all commands.

thank you for your help.