Page 1 of 1
Apache Tomcat monitoring for Windows installations
Posted: Tue Jul 27, 2021 12:47 pm
by dlukinski
We are unable to monitor Apache Tomcat installations done on Windows with XI Tomcat monitoring Wizard
- how to configure Windows installations to work with XI monitoring?
NCPA-based looks this way: UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')
- ver 2.3.1 / would it be urf8 problem with plans to be fixed only in NCPA 3?
JMX-based is as follows: UNKNOWN: Failed to connect: Failed to retrieve RMIServer stub: javax.naming.ConfigurationException [Root exception is java.rmi.UnknownHostException: Unknown host: XXXXXXXXX: nested exception is:
- seem to be the switch to the random port after the initial connection. Any way to deal with it?
Re: Apache Tomcat monitoring for Windows installations
Posted: Tue Jul 27, 2021 6:09 pm
by gsmith
Hi
First check that the command has been updated with the correct path to java:
Image2.jpg
Next configure your service as:
Image1.jpg
where the arguments are:
$ARG1$:
Code: Select all
-s service:jmx:rmi:///jndi/rmi://192.168.23.82:9010/jmxrmi -t tomcat -C 'MemorySimpleHeap,MemoryMetaspace,ProcessCPUUsage,SystemCPUUsage,Uptime' -w '17179869184,34359738368,50,70,1500000:' -c '32212254720,68719476736,70,90,300000:'
$ARG2$:
On my system I had to create /usr/local/tomcat/bin/setenv.sh:
Code: Select all
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=192.168.23.82"
JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true "
And on the jmx host I had to open up port 9010 in the firewall.
Let me know how things turn out please.
Thanks
Re: Apache Tomcat monitoring for Windows installations
Posted: Wed Aug 18, 2021 3:46 pm
by dlukinski
We have discovered that Windows Apache does NOT keep communications over the initial port.
It switches to the random port.
Would like to have your opinion on the matter
Re: Apache Tomcat monitoring for Windows installations
Posted: Wed Aug 18, 2021 6:46 pm
by gsmith
Hi,
I missed one of the java_opts you need.
On your Windows Tomcat server you need these options to java when launching Tomcat.
The easiest way to do that is from Start, Tomcat, Configure Tomcat. It must be
written to some file(s) but I didn't track them down right now.
Code: Select all
-Dcatalina.home=C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5
-Dcatalina.base=C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5
-Djava.io.tmpdir=C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Program Files (x86)\Apache Software Foundation\Tomcat 8.5\conf\logging.properties
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.rmi.port=9010
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=192.168.23.96
-Djava.net.preferIPv4Stack=true
-Djava.net.preferIPv4Addresses=true
Adding this second port parameter:
-Dcom.sun.management.jmxremote.rmi.port=9010
is what solves the random port issue.
Thanks