Page 1 of 1

Check apache tomcat Heap information

Posted: Wed Feb 27, 2019 12:52 am
by anuruddhak
I already try everything from this link but no luck
https://exchange.nagios.org/directory/P ... che-Tomcat

Is there any other way to monitor apache tomcat memory informations using nagios core ?

Re: Check apache tomcat Heap information

Posted: Wed Feb 27, 2019 5:32 pm
by tgriep
I have used this plugin to test Memory Heap on a Tomcat server running on a Centos7 system.

Code: Select all

https://exchange.nagios.org/directory/Plugins/Java-Applications-and-Servers/Syabru-Nagios-JMX-Plugin/details
Example command you can create.

define command {
command_name check_jmx
command_line $USER1$/check_jmx $ARG1$
}

After you create the command, the following is an example of what you would use for the Service Check Argument. Replace xxx.xxx.xxx.xxx with the IP address of the Tomcat server anf yyyy to the port.
-U service:jmx:rmi:///jndi/rmi://xxx.xxx.xxx.xxx:yyyy/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used

Finally, you will have to reconfigure the Tomcat server to allow remote connections so the Nagios server can gather the data.
This link should help on that.
http://stackoverflow.com/questions/1263 ... g-jconsole

Re: Check apache tomcat Heap information

Posted: Thu Feb 28, 2019 4:58 am
by anuruddhak
@tgriep Thank you for your response.

Actually I manged to write own script to get those information and it's working nicely.

# ./check_heap_tomcat
Tomcat Mem:3GB/15GB (21%) and JVM Mem:1GB/7GB (14%)

Alreaday Try to upload this script to here but Unable to do that due to error in webpage
https://exchange.nagios.org/directory/P ... nd-Servers

Re: Check apache tomcat Heap information

Posted: Thu Feb 28, 2019 11:48 am
by scottwilkerson
anuruddhak wrote:Actually I manged to write own script to get those information and it's working nicely.
Glad you got it working!
anuruddhak wrote:Alreaday Try to upload this script to here but Unable to do that due to error in webpage
https://exchange.nagios.org/directory/P ... nd-Servers
What error were you getting?

Re: Check apache tomcat Heap information

Posted: Fri Mar 01, 2019 2:31 am
by anuruddhak
when I try to post I got the "You need to login first before you can add a listing"

after the logged in got the "Invalid Token"

Re: Check apache tomcat Heap information

Posted: Fri Mar 01, 2019 7:39 am
by scottwilkerson
Hmm, I just tested this and it appears to be working. Do you have JS enabled?

Does the Login box say "Hi Your Name," ?