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 測試管理頁是否生效
參考網頁數據
注意需要監控的 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中對應項目修改
最後更新:2017-04-03 16:48:59