1、打开Tomcat的status页面,方法为编辑Tomcat的conf目录下的tomcat-users.xml文件,在文件中添加
<tomcat-users> <role rolename="manager"/> <user username="admin" password="pass" roles="manager"/> </tomcat-users> |
lr_start_transaction("monitor tomcat"); web_reg_save_param("JVMFreeMemory", "LB=Free memory: ", "RB= MB", "Ord=1", LAST); web_reg_save_param("JVMTotalMemory", "LB=Total memory: ", "RB= MB", "Ord=1", LAST); web_reg_save_param("JVMMaxMemory", "LB=Max memory: ", "RB= MB", "Ord=1", LAST); web_url("status", "URL=http://{ServerName}/manager/status", "Resource=0", "RecContentType=text/html", "Referer=", "Snapshot=t1.inf", "Mode=HTTP", LAST); lr_end_transaction("monitor tomcat", LR_AUTO); // Tomcat JVM metrics lr_user_data_point("Tomcat JVM Free memory", atof(lr_eval_string("{JVMFreeMemory}"))); lr_user_data_point("Tomcat JVM Total memory", atof(lr_eval_string("{JVMTotalMemory}"))); lr_user_data_point("Tomcat JVM Max memory", atof(lr_eval_string("{JVMMaxMemory}"))); |