Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Mon May 21, 2012 8:57 am


ATTENTION: All users passwords have been cleared.
Please use the "Forgot Password" feature to reset your password.


All times are UTC - 5 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Monitoring Tomcat and JVM via Tomcat jmxproxy
PostPosted: Tue Apr 28, 2009 10:13 am 
Offline

Joined: Mon Apr 27, 2009 3:38 pm
Posts: 4
Uses the jmxproxy that comes built in with tomcat manager to monitor Tomcat and the JVM. Lets you monitor the following:

Garbage Collectors
Time spent garbage collecting
Numer of collections

Memory Pools
Max
Used
Committed

Tomcat Thread Pools
Size
Numer of busy threads

Web Modules (contexts)
Total processing time for module.

Servlets
Requests / second
Total time
Time / Request

Any MBean
You can use the query script to get data from any MBean.


Data is collected using a perl script. Tested on Ubuntu 8.04 and cacti 0.8.7b


Attachments:
threadpool.png
threadpool.png [ 27.14 KiB | Viewed 17947 times ]
File comment: Thread Pool
cacti-tomcat-0.8.tar.gz [13.02 KiB]
Downloaded 1659 times
File comment: Servlet
servlet.png
servlet.png [ 30.66 KiB | Viewed 17947 times ]
File comment: Mem Pool
oldgen.png
oldgen.png [ 27.24 KiB | Viewed 17947 times ]
File comment: GC
gc.png
gc.png [ 32.25 KiB | Viewed 17947 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 09, 2009 3:47 pm 
Offline

Joined: Wed Sep 09, 2009 3:45 pm
Posts: 2
Thanks a lot for these scripts and templates! Having a little trouble with the perl script though, trying to set the port to 8080. It doesn't seem to recognize the change. Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 09, 2009 4:04 pm 
Offline

Joined: Wed Sep 09, 2009 3:45 pm
Posts: 2
I figured it out, line 313 should be changed to this:

my $url = $proto."$host:$port".$jmxurl.$qry;

However, still having some trouble. Which version of Tomcat/Java was this tested with?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 25, 2010 3:54 am 
Offline

Joined: Thu Mar 25, 2010 3:48 am
Posts: 6
Also have problems with Tomcat 6.0. Could you please tell me which Tomcat/Java version your script works with?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2010 3:42 am 
Offline

Joined: Thu Jul 29, 2010 3:36 am
Posts: 1
Got this working with Tomcat 6.0 by

a) editing each xml file to have the full perl binary path in it eg

<script_path>/usr/bin/perl |path_cacti|/scripts/tomcat_stats.pl</script_
path>

b) In cacti settings | visual | maximum field length, change from 30 to 80

This is with cacti 0.8.7e


Top
 Profile  
 
 Post subject: Re: Monitoring Tomcat and JVM via Tomcat jmxproxy
PostPosted: Fri Oct 15, 2010 4:29 pm 
Offline
Cacti User

Joined: Thu May 17, 2007 9:18 am
Posts: 231
I am not able to get the graphs working. I can access the tomcat url from the cacti server:

1. when open this url from cacti, I get results withing the browser: http://<ip address of tomcat server>:7101/manager/jmxproxy/?qry=

2:
Code:
OK - Number of results: 50

Name: FetchCatalina:type=Manager,path=/,host=localhost
modelerType: org.apache.catalina.session.StandardManager
algorithm: MD5
randomFile: /dev/urandom
className: org.apache.catalina.session.StandardManager
distributable: false
entropy: org.apache.catalina.session.StandardManager@eaf40c
maxActiveSessions: -1
maxInactiveInterval: 1800
processExpiresFrequency: 6
sessionIdLength: 16
name: StandardManager
pathname: SESSIONS.ser
activeSessions: 0
sessionCounter: 1
maxActive: 10
sessionMaxAliveTime: 1859
sessionAverageAliveTime: 1823
rejectedSessions: 0
expiredSessions: 20
processingTime: 0
duplicates: 0

Name: FetchCatalina:type=RequestProcessor,worker=http-7101,name=HttpRequest3
modelerType: org.apache.coyote.RequestInfo
bytesSent: 90471
remoteAddr: 172.25.207.147
requestBytesSent: 0
contentLength: -1
bytesReceived: 0
requestProcessingTime: 25610
globalProcessor: org.apache.coyote.RequestGroupInfo@12cd8d4
maxRequestUri: /agent/admin/status
requestBytesReceived: 0
serverPort: -1
stage: 7
requestCount: 115
maxTime: 16
processingTime: 92
errorCount: 64



3. when I try to add the data query or manually execute the script against this tom cat server, I get nothing back:

D:\cacti\scripts>tomcat_stats.pl <ip address of tomcat > gc index

D:\cacti\scripts>

what am I missing, I think I am very close. please help.

thanks


Top
 Profile  
 
 Post subject: Re: Monitoring Tomcat and JVM via Tomcat jmxproxy
PostPosted: Tue Jan 04, 2011 5:53 am 
Offline

Joined: Tue Dec 28, 2010 5:27 am
Posts: 1
Hi, I have the same probleme

"
3. when I try to add the data query or manually execute the script against this tom cat server, I get nothing back:

D:\cacti\scripts>tomcat_stats.pl <ip address of tomcat > gc index"

any feedback ?

Tomcat6


Top
 Profile  
 
 Post subject: Re: Monitoring Tomcat and JVM via Tomcat jmxproxy
PostPosted: Thu Jan 20, 2011 7:55 am 
Offline
Cacti Guru User
User avatar

Joined: Thu Jan 31, 2008 6:39 am
Posts: 1315
Location: Kressbronn, Germany
Hi all,

The script needs to be changed for Tomcat 6, as the jmxurls changed:

At around line 66 replace the qry strings with the following:
Code:
        if($mode eq "tp")
        {
                $qry = "*%3Atype%3DThreadPool%2C*";
        }
        elsif($mode eq "gc")
        {
                $qry = "*%3Atype%3DGarbageCollector%2C*";
        }
        elsif($mode eq "mp")
        {
                $qry = "*%3Atype%3DMemoryPool%2C*";
        }
        elsif($mode eq "wm")
        {
                $qry = "Catalina%3Aj2eeType%3DWebModule%2CJ2EEApplication%3Dnone%2CJ2EEServer%3Dnone%2C*";
        }
        elsif($mode eq "sv")
        {
                $qry = "Catalina%3Aj2eeType%3DServlet%2CJ2EEApplication%3Dnone%2CJ2EEServer%3Dnone%2C*";
        }

_________________
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti Book
---
Author of the nmid Plugins
Author of the nmidClient for Android
Author of the CereusReporting plugin( formerly know as nmidCreatePDF )


Top
 Profile  
 
 Post subject: Re: Monitoring Tomcat and JVM via Tomcat jmxproxy
PostPosted: Wed May 04, 2011 2:48 pm 
Offline

Joined: Mon Dec 06, 2010 4:58 am
Posts: 1
hi,

First very good template and good work.

The template work for:

Tomcat Servlet
Tomcat ThreadPool
Tomcat WebModule

But not for:

Tomcat GC Stats
Tomcat MemPool

My problem come from tomcat because i don't have any output from this URL:

http://host:port/manager/jmxproxy/?qry=*:type=%28GarbageCollector|MemoryPool%29,*

I don't understand why.
Is there anyone that know why?

I'm on a linux tomcat test box with:

OS: debian 5.3
Tomcat: Tomcat 5.5
JDK: 1.6.0_22-b04 and 1.5.0_22-b03 (same issue with both)

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group