本文主要是介绍tomcat7 - cacti 备忘,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
模板下载位置
https://codeload.github.com/hobbiesness/Cacti-Tomcat/zip/master |
增加安全管理设定
/usr/local/tomcat/conf/tomcat-users.xml
<tomcat-users> <role rolename="manager-gui" /> <role rolename="manager-script" /> <!-- <role rolename="manager-jmx" /> <role rolename="manager-status" /> <user username="username" password="yourpassword" roles="manager-gui,manager-script,manager-jmx,manager-status" /> --> <user username="username" password="yourpassword" roles="manager-gui,manager-script"> </tomcat-users> |
重启 tomcatd 测试管理页是否生效
http://X.X.X.X:8080/manager/status?XML=true |
参考网页数据
注意需要监控的 connector命名
测试
/usr/local/bin/php fetchTomcatStats.php username password tomcat_a 8080 \"http-bio-8080\" free:894417384 total:1020002304 max:1020002304 maxThreads:200 currentThreadCount:0 currentThreadsBusy:0 maxThreads:200 currentThreadCount:10 currentThreadsBusy:1 maxTime:0 processingTime:0 requestCount:0 errorCount:0 bytesReceived:0 bytesSent:0 maxTime:1413 processingTime:4715 requestCount:279 errorCount:5 bytesReceived:0 bytesSent:3178055 |
注: bash测试时需定义\"http-bio-8080\",cacti定义connector 是"http-bio-8080”
manager-gui 允许访问html接口(即URL路径为/manager/html/*)
manager-script 允许访问纯文本接口(即URL路径为/manager/text/*)
manager-jmx 允许访问JMX代理接口(即URL路径为/manager/jmxproxy/*)
manager-status 允许访问Tomcat只读状态页面(即URL路径为/manager/status/*)
manager-gui、manager-script、manager-jmx均具备manager-status 权限
manager-gui、manager-script、manager-jmx角色权限无需再额外添加manager-status权限
可直接访问路径/manager/status/*
把 cacti_host_template_tomcat_server.xml导入 cacti后修改
配置过程中,注意下面连接方法的定义
假如修改了管理密码,需要在菜单 management - Data Sources - RRAs中对应项目修改
这篇关于tomcat7 - cacti 备忘的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!