//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}")));
return 0;
}
运行结果:
Starting action Action.
Action.c(6): Notify: Transaction "monitor tomcat" started.
Action.c(8): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(14): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(20): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(26): web_set_user was successful [MsgId: MMSG-26392]
Action.c(28): Error -26628: HTTP Status-Code=403 (Forbidden) for "http://127.0.0.1:8080/manager/status" [MsgId: MERR-26628]
Action.c(28): Error -26377: No match found for the requested parameter "JVMFreeMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Action.c(28): Error -26377: No match found for the requested parameter "JVMTotalMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Action.c(28): Error -26377: No match found for the requested parameter "JVMMaxMemory". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Action.c(28): web_url("status") highest severity level was "ERROR", 5813 body bytes, 681 header bytes, 24 chunking overhead bytes [MsgId: MMSG-26387]
Action.c(28): Notify: Transaction "monitor tomcat" ended with "Fail" status (Duration: 0.6659 Wasted Time: 0.5223).
Ending action Action.