TOUVE 发表于 2015-11-22 11:13:14

tomcat7

  模板下载位置
  https://codeload.github.com/hobbiesness/Cacti-Tomcat/zip/master
  
   增加安全管理设定
  /usr/local/tomcat/conf/tomcat-users.xml
  
  <tomcat-users>
     <role rolename=&quot;manager-gui&quot; />
     <role rolename=&quot;manager-script&quot; />
  <!--
     <role rolename=&quot;manager-jmx&quot; />
     <role rolename=&quot;manager-status&quot; />
     <user username=&quot;username&quot; password=&quot;yourpassword&quot;
   roles=&quot;manager-gui,manager-script,manager-jmx,manager-status&quot;/>
  -->
     <userusername=&quot;username&quot; password=&quot;yourpassword&quot; roles=&quot;manager-gui,manager-script&quot;>
  </tomcat-users>
  
  重启 tomcatd 测试管理页是否生效
  
  http://X.X.X.X:8080/manager/status?XML=true
  
  参考网页数据

  注意需要监控的 connector命名
  
  测试
  /usr/local/bin/phpfetchTomcatStats.phpusername password tomcat_a 8080 \&quot;http-bio-8080\&quot;
  free:894417384 total:1020002304max:1020002304 maxThreads:200 currentThreadCount:0 currentThreadsBusy:0maxThreads:200 currentThreadCount:10 currentThreadsBusy:1 maxTime:0processingTime:0 requestCount:0errorCount:0 bytesReceived:0 bytesSent:0maxTime:1413 processingTime:4715 requestCount:279 errorCount:5bytesReceived:0 bytesSent:3178055
  
  注:bash测试时需定义\&quot;http-bio-8080\&quot;,cacti定义connector是&quot;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中对应项目修改
  
  
页: [1]
查看完整版本: tomcat7