apache/tomcat monitoring
Moderators: Developers, Moderators
- inetquestion
- Cacti User
- Posts: 67
- Joined: Wed Feb 01, 2006 11:13 am
- Location: Charlotte NC
apache/tomcat monitoring
I'm looking for some tools either built into apache/tomcat or auxiliary scripts which could be used to extract performance data and hopefully integrate with cacti. Given that there appear to be quite a few of these out there I was also hoping for some guidance on which ones are the most comprehensive and have the least problems with their use.
Regards,
-Inet
Regards,
-Inet
I am interested in the same monitoring templates.
I have an idea of how to get the data, but for the moment, I would have to parse a lot of data to get the values
For example, the following URL will return information about memory usage... but it gives a lot of data back.
http://hostname:8080/manager/jmxproxy/? ... oryPool%2C*
I will look into this and post my findings here.
I have an idea of how to get the data, but for the moment, I would have to parse a lot of data to get the values
For example, the following URL will return information about memory usage... but it gives a lot of data back.
http://hostname:8080/manager/jmxproxy/? ... oryPool%2C*
I will look into this and post my findings here.
Tomcat supports quite a diverse amount of information via SNMP, especially if run through JBOSS. You can even publish specific EXEC commands to OIDs and this works nicely.myfreeke wrote:I have more than 100 servers use tomcat
How to monitor tomcat?
More details?
However, I have found most of the time it's simpler to just create a shell script that parses a health page. E.g., # of connections, free memory, GC information, a script that simulates a connection through Tomcat to the database, and so on. If you don't know where to start with this ask your developers to create a JSP or JMX page with this information.
More examples:
http://www.opennms.org/index.php/Tomcat_5.5_JMX_How-To
http://forums.adventnet.com/viewtopic.php?t=959&start=0
http://jakarta.apache.org/jmeter/userma ... -plan.html
then again Jboss has its own internal (pretty advanced) snmp monitoring. But if you dont use Jboss with tomcat....then its a bit harder.
I dont even think tomcat alone supports snmp. However if you choose to use bea jrockit for your java engine...and not sun jdk....then jrockit supports snmp....therefor you could pull some jvm stats from jrockit. I just havent got around to figuring this out.
anyone up for the task? ahah.
I dont even think tomcat alone supports snmp. However if you choose to use bea jrockit for your java engine...and not sun jdk....then jrockit supports snmp....therefor you could pull some jvm stats from jrockit. I just havent got around to figuring this out.
anyone up for the task? ahah.
If all else fails, rm -rf /
Let me give a more concrete example:
</etc/crontab>
* * * * * /usr/bin/yourupdateprogram > /dev/null
</>
<snmpd.conf>
sh .1.3.6.1.4.1.8081 TomcatThreads /usr/local/bin/snmp-tomcat-busythreads
sh .1.3.6.1.4.1.8082 TomcatFreemem /usr/local/bin/snmp-tomcat-freemem
</>
<cacti>
Add data source of type "SNMP - Generic OID Template". Set "Maximum Value" to some very huge number, say 10000000000. Put in OID value 1.3.6.1.4.1.8081.101.1 (for busy threads) and 1.3.6.1.4.1.8082.101.1 (for free memory).
</>
You can use any OIDs you want, they just have to match up and not be in use. Don't forget to restart snmpd after you update it. Test with snmpwalk before you get to cacti's complexity.
In this case, I have crontab running a job every minute that dumps data to /tmp/somefile. The /usr/local/bin programs are executed by SNMPd (from a Cacti request over SNMP-OID). They get data from /tmp/somefile that cron dumped the data into.
</etc/crontab>
* * * * * /usr/bin/yourupdateprogram > /dev/null
</>
<snmpd.conf>
sh .1.3.6.1.4.1.8081 TomcatThreads /usr/local/bin/snmp-tomcat-busythreads
sh .1.3.6.1.4.1.8082 TomcatFreemem /usr/local/bin/snmp-tomcat-freemem
</>
<cacti>
Add data source of type "SNMP - Generic OID Template". Set "Maximum Value" to some very huge number, say 10000000000. Put in OID value 1.3.6.1.4.1.8081.101.1 (for busy threads) and 1.3.6.1.4.1.8082.101.1 (for free memory).
</>
You can use any OIDs you want, they just have to match up and not be in use. Don't forget to restart snmpd after you update it. Test with snmpwalk before you get to cacti's complexity.
In this case, I have crontab running a job every minute that dumps data to /tmp/somefile. The /usr/local/bin programs are executed by SNMPd (from a Cacti request over SNMP-OID). They get data from /tmp/somefile that cron dumped the data into.
Tomcat Template
If anyone is interested in helping me test - I've got some Tomcat templates/scripts I whipped up. The template relies on a script which polls the standard Tomcat Manager app for data.
- Attachments
-
- 1graph_image.png (43.9 KiB) Viewed 69265 times
-
- 2graph_image.png (43.22 KiB) Viewed 69265 times
-
- 3graph_image.png (23.78 KiB) Viewed 69265 times
-
- 4graph_image.png (38.55 KiB) Viewed 69265 times
-
- Cacti Guru User
- Posts: 1884
- Joined: Mon Oct 16, 2006 5:57 am
- Location: United Kingdom
- Contact:
Re: Tomcat Template
Could you post your templates please ? I've got 2 Tomcat servers with JBOSS I'd like to monitor.timdenike wrote:If anyone is interested in helping me test - I've got some Tomcat templates/scripts I whipped up. The template relies on a script which polls the standard Tomcat Manager app for data.
Thanks
Cacti Version 0.8.8b
Cacti OS Ubuntu LTS
RRDTool Version RRDTool 1.4.7
Poller Information
Type SPINE 0.8.8b
Re: Tomcat Template
Not sure whether this will work with JBoss since this uses the Tomcat manager app to request XML data - if anyone can make this work, please let me know so I can iron the kinks out.mcutting wrote: Could you post your templates please ? I've got 2 Tomcat servers with JBOSS I'd like to monitor.
- Attachments
-
- TomcatStats-0.1.zip
- (8.54 KiB) Downloaded 9696 times
Thank you for the great work
As a note, the script works better ( just tried it ) if you would replace
`GET $xml` with direct usage of LWP::Simple, i.e.
at the top and retrieve the XML using
Thanks again.
Robert
As a note, the script works better ( just tried it ) if you would replace
`GET $xml` with direct usage of LWP::Simple, i.e.
Code: Select all
use LWP::Simple;
Code: Select all
my $xml = get($url);
Robert
Thanks!rombert wrote: As a note, the script works better ( just tried it ) if you would replace
`GET $xml` with direct usage of LWP::Simple, i.e.
I tried using LWP initially but had issues getting it to work (easily) with the HTTP auth... The GET is definitely a cheap and dirty hack. Were you able to make it work with a http://user:pass@host:port/uri type URL?
Who is online
Users browsing this forum: No registered users and 1 guest