ngrinder 无法获取目标机器上资源信息,提示:
016-06-12 16:01:23,735 INFO MonitorCollectorPlugin.java:86 : Start JVM monitoring for IP:192.168.84.174
2016-06-12 16:01:23,738 INFO MBeanClient.java:82 : Timeout while connecting to 192.168.84.174:13243 monitor : {}
ngrinder/ngrinder-controller/src/main/resources/ngrinder_agent_home_template/agent_monitor.conf
中描述的 monitor.binding_port=hostname_or_ip 有误,修正为:monitor.binding_ip=hostname_or_ip
查看 ngrinder 源码发现里面 agent.conf 需要指定 IP
ngrinder/ngrinder-core/src/main/java/org/ngrinder/common/constants/MonitorConstants.java:
public interface MonitorConstants {
public static final String PROP_MONITOR_BINDING_IP = "monitor.binding_ip";
public static final String PROP_MONITOR_BINDING_PORT = "monitor.binding_port";
/**
* Monitor Constant
*/
public static final int DEFAULT_MONITOR_COLLECTOR_INTERVAL = 1;
public static final String DEFAULT_MONITOR_DOMAIN = "org.ngrinder.monitor";
public static final String SYSTEM = "name=System";
public static final String MONITOR_FILE_PREFIX = "monitor_system_";
}
common.start_mode=monitor
# If you want to monitor bind to the different local ip not automatically selected ip. Specify below field.
monitor.binding_ip=192.168.84.174
monitor.binding_port=13243
备注:192.168.84.174 为目标机器 IP。