Apache Tomcat

check_tomcat.pl

Description:

check the tomcat /manager/status page for excessive memory usage or an excessive number of threads in use.

Current Version

1.4

Last Release Date

2011-12-15

Compatible With

License

GPL


Project Files
Project Notes
This plugin does a HTTP GET of the tomcat status page: /manager/status?XML=true It checks the resulting XML for: * Low free memory * Excessive thread usage Note that although this sounds quite useful, the nature of garbage collection in Java means that this plugin is prone to 'false positives' when reporting memory usage. ie. it will complain about low memory, which may be fixed by the next garbage collection. I suggest setting the critical threshold for memory quite low - 50 Mbytes or less. It is also useful to set the 'max_check_attempts' higher than usual to give garbage collection time to kick in. This plugin has proved useful in debugging, by picking up the time when a problem started, as distinct from when the tomcat actually failed. This plugin requires the following perl libraries, available with most Linux distributions or from cpan.org LWP - The World-Wide Web library for Perl XML::XPath - for parsing and evaluating XPath statements These are possibly packaged as: perl-libwww-perl perl-XML-XPath v1.2 released 2011-11-30 can check any connector-name. If invoked with '-n .' will check ALL connectors mentioned in the XML status report. v1.3 released 2011-12-15 adds currentThreadCount to the performance data reported by this plugin. v1.4 released 2013-03-15 fixes a bug where the warning and critical values for threads was not being correctly calculated on the second and subequent connectors. Also changed MB to MiB.
Reviews (4) Add a Review
It Works!
by jose.a.guardia, May 31, 2016

It works on CentOS 6.4 + Tomcat 7.0.69



Getting error while running
by gouravjoshi, March 31, 2013

#./check_tomcat_test.pl -H -p -l -a -u '/manager/status?XML=true' Running above command throws below error; PositionContext: Parse position is outside of buffer at /usr/local/lib64/perl5/XML/Parser/Expat.pm line 344. Running with verbose getting; Connecting to : --------------- GET http://:/manager/status?XML=true Host: : User-Agent: libwww-perl/5.833 --------------- HTTP/1.1 200 OK Cache-Control: private Connection: close Date: Date Server: Apache-Coyote/1.1 Content-Length: 2442 Content-Type: text/xml;charset=utf-8 Expires: Thu, 01 Jan 1970 01:00:00 Client-Date: DATE Client-Peer: : Client-Response-Num: 1 Content has 2442 bytes PositionContext: Parse position is outside of buffer at /usr/local/lib64/perl5/XML/Parser/Expat.pm line 344.



Works great.
by sridhar21s, October 31, 2012

This works great with tomcat 7.



tomcat7
by unique, October 31, 2011

It is not working with tomcat 7 ... It would be great if you can fix this issue. Thanks!



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.7 (9)
Favorites
3
Views
169,830