monitor tomcat use Zabbix

        I would like to know how to monitor tomcat use Zabbix. my tomcat run on CentOS 6.5 and zabbix run on other CentOS6.5 server.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Artysystem administratorCommented:
I see 3 different questions.
- If you don't know WHAT to monitor on tomcat
- if you don't know HOW to monitor whatever you want
- if you don't know how to manage ZABBIX metrics for whatever you monitor

1. If you don't know WHAT to monitor
The most useful part is a response time and hit rate, which can be parsed from access logs.
We monitor average response time and percentiles. Access log format is quite flexible and you can change it:
You may also monitor number of currently opened connections.
Next important things that we usually monitor on a high-load for any java application are java heap space utilization, garbage collection pauses and may be some application specific metrics, exported via JMX.

2. If you don't know HOW to monitor
There are also different approaches, the result should be a metric name and a number, associated with this metric.
Say for parsing access logs we use custom python script, that once a 30 seconds create aggregated metrics (hits, response time centiles, ...) and send them with a zabbix_sender (for metrics of the type 'zabbix trapper').

For monitoring java heap/garbage collection statistics we use 'jstat' application from standard JDK.
For monitoring JMX exported metrics we use 'cmdline-jmxclient.jar', old and unsupported, but still functional cmdline-jmxclient.jar application.

3. Except zabbix trapper metrics and trapper senders, you may also use file with statistics, that is updated from crontab, and then have a metrics definition in zabbix_agentd.conf with one-liner for extracting appropriate values from the file, like:
UserParameter=resp.avg, (egrep "^avg " /tmp/resp_time_stats || echo a 0) | cut -d \  -f 2

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Displays / Monitors

From novice to tech pro — start learning today.