probe
probe是一个只需要扔个war包进去就可以监控tomcat、jvm运行情况的项目,配置超级简单,看Jmeter实战书中发现的
项目地址:https://github.com/psi-probe/
粘贴一段官方的介绍
Unlike many other server monitoring tools, PSI Probe does not require any changes to your existing apps. It provides all of its features through a web-accessible interface that becomes available simply by deploying it to your server. These features include:
- Requests: Monitor traffic in real-time, even on a per-application basis.
- Sessions: Browse/search attributes, view last IP, expire, estimate size.
- JSP: Browse, view source, compile.
- Data Sources: View pool usage, execute queries.
- Logs: View contents, download, change levels at runtime.
- Threads: View execution stack, kill.
- Connectors: Status, usage charts.
- Certificates: System trust store and connector keystore / * truststore
- Cluster: Status, usage charts.
- JVM: Memory usage charts, advise GC
- Java Service Wrapper: Restart JVM.
- System: CPU usage, memory usage, swap file usage.
安装
# wget https://github.com/psi-probe/psi-probe/releases/download/3.0.0/probe.war
配置jvm开启远程调试
root@128b6b436d37:/usr/local/tomcat# head bin/catalina.sh
#!/bin/sh
export CATALINA_OPTS="$CATALINA_OPTS -Duser.timezone=Asia/Shanghai -Dcom.sun.management.jmxremote"
配置访问控制
root@128b6b436d37:/usr/local/tomcat# cat conf/tomcat-users.xml
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="user" password="passwd" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/>
</tomcat-users>
重启tomcat
root@128b6b436d37:/usr/local/tomcat# ./bin/shutdown.sh && ./bin/startup.sh
观察日志检查是否启动
catalina.out无明显异常则应该启动成功,访问http://url/probe可以probe页面
下午偷懒看书时(Jmeter实战),看到一款tomcat监控工具psi-probe,简单了解了下,非常的厉害,manager能做的它都可以做,而且初次之外还可以看到更多的性能数据,例如各个项目的请求情况,Tomcat线程状态,线程在执行那些代码,堆非堆使用情况等等,但是有一个问题就是,这个项目没有http api,这就优点让人头大了,如果提供http api的话就非常容易集成进zabbix监控中去了,但是google、github、甚至连g+找了一圈都没有发现,这着实让人难受~