linux CPU, IO, Memery monitoring

jmeter also can monitor CPU and memory usage of the server, but also need to install some plug-ins need to open service on the monitored server.

1. The need for plug-in ready

 

① JMeterPlugins-Extras-1.1.2.zip

② JMeterPlugins-Standard-1.1.2.zip

1,2 Download: https://jmeter-plugins.org/downloads/old/

3 .  ServerAgent-2.2.1

3 Download  https://github.com/undera/perfmon-agent

 

 

2.Jmeter master server

① and ② after decompression, we need to copy JMeterPlugins-Extras.jar and JMeterPlugins-Standard.jar to the next Jmeter \ lib \ ext directory.

Start jmeter, added some @ beginning jp gc listener listener options, the monitoring cpu, memory, i / o monitor is jp @ gc -PerfMon Metrics Collector

 

serverAgent.zip Download:

https://github.com/undera/perfmon-agent

 

Three .agentserver start:

Add Row can be added to the need to monitor the server ip, port number defaults to 4444, monitor the content of CPU / MEMORY / DISKS I / O, etc.

3.agent server

The rear ServerAgent-2.2.1.zip unpacked on the server you want to monitor, and turn

startAgent.bat(windows)

startAgent.sh (Linux)

On linux server first startAgent.sh set to executable files:

chmod 777 startAgent.sh

./startAgent.sh executable file

If you want to set the background without closing the file

Nohup ./startAgent.sh &

Add Row can be added to the need to monitor the server ip, port number defaults to 4444, monitor the content of CPU / MEMORY / DISKS I / O, etc.

3.agent server

The rear ServerAgent-2.2.1.zip unpacked on the server you want to monitor, and turn

startAgent.bat(windows)

startAgent.sh (Linux)

On linux server first startAgent.sh set to executable files:

chmod 777 startAgent.sh

./startAgent.sh executable file

If you want to set the background without closing the file

Nohup ./startAgent.sh &

IV. The results View

在服务器上开启startAgent服务后,再在jmeter上运行脚本,可以在jp@gc - PerfMon Metrics Collector上查看监控的图形结果

注意事项:

执行时监控cpu的插件可能会报错

java.io.IOException: Agent is unreachable via TCP

windows环境下解决方法:

serveragent的默认端口为4444,使用jmeter监听器时,有时即使开启了agent服务也会无法监听,这时候可能是端口被占用了,需要修改端口,那么该如何做呢?

1、cmd命令进入ServerAgent的根目录;

2、在cmd中输入: java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 5555 --tcp-port 5555

 

Guess you like

Origin www.cnblogs.com/SunshineKimi/p/11361216.html