PerfMon-JMeter Server Monitoring PlugIn

In this article we are going to see what are additional features/items added after installing jmeter plugin (Google Plugin) and what we can do with it. I will discuses about Listeners only. To know about basic of jmeter see my this page. And, the process to install plug in , see this post.

What is PerfMon plugins? It is a server monitor plugin , where we can check the health of the server from jmeter while running. The supported list is here. And we can test on web server that we are generating load on as well as remote servers where our remote agents are running.
So, by the objective of the plug in, we clearly understand there will be two component. One is, jmeter listener which will be running with jmeter. And another one will be on the server, which will send info to jmeter listener about the server.
From this download link, download server plugins(currently version 2.2.1), and install plugins to jemter.

-After download the server agent on server, and run startAgent.bat in windows or in Linux server. It will open UDP/TCP server ports where jmeter will communicate.

-Now, we have to add jp@gc - PerfMon Metrics Collector  this listener in our jmeter test plan. (controller PC, where we are running jmeter)

-Select jp@gc - PerfMon Metrics Collector and click add a row
-In a row, we have to add server IP/address( where the server agent is present),Port number, the information that we want (CPU/memory) from a selectable comb and a metric parameter. So, here is a generic screenshot.

So, now we can run, our test and see the log file. I have used a sample dummy sampler(not real test) to get some viewable report.
Running screen shot1
Running screen shot2

Metric parameter:
Metric parameter are sub type or options under main metric controller. It is basically a string constructor that goes as parameter. It helps for making understandable metrics as well as helps to get specific info that we need. So, for Nine type of metric controllers we have nine metric parameters. Screenshots are here.
1. Metric parameter-CPU
2. Metric parameter-Memory
3. Metric parameter-Disk IO 
4. Metric parameter-Network IO
5. Metric parameter-Swap 
6. Metric parameter-TCP
7. Metric parameter-JMX 
8. Metric parameter-EXEC
9. Metric parameter-TAIL

Agent Tweaking :
1. We can enable or disable any port by shell command. Port 0 for disabled. We have to run our in following manner 
Syntax : $ ./ --<ProtocallPort> <port number>
Ex : To enable UDP at port 5000 : we need to run this in command prompt.
$ ./ --udp-port 5000
Or, to disable TCP port
$ ./ --tco-port 0

2. We can Auto Shutdown agent after test completion
Syntax : $ ./ --<ProtocallPort> <port number> --auto-shoutdown
 EX- $ ./ --udp-port 5000 --auto-shutdown

3. We can use system Info showing for system object while running, 
$ ./ --sysinfo

Notes : 
-No Need Admin privilege in the server
-Server agent needs JRE 1.4+ version. So, you need that installed in server.(or you can add jre package inside the folder. In that case, you have to edit bat file)
-We can use multiple servers. To do that , multiple server should have the agent.

Agent Extension : Following this interface kg.apc.perfmon.client.Transport , we can use this plug in for other software using, like custom performance monitor. I will make a separate post on how can we make a class on JAVA to use this plugin for getting information.



  1. I followed the same steps and I need to be on VPN to connect to the server so when i connect and run the server agent on the server and then run my jmeter from my machine i get error as below:

    ERROR: Connection timed out: connect

    Do you why this is happening?Do i need to change any property file or any other config file?

    1. have you properly set up RMI registry? The exception shows connection problem because of timeout. I think , because of VPN, you cant access PC via jmeter default configuration. Send me detail exception and steps, i might can help to configure your jmeter to support properly.

    2. Hello, you managed to solve the problem? If so can you provide the solution please? I have the same problem. I succeed to doing telnet on the server (RedHat), I succeed doing the test with JMeter with the agent in my local machine. But I am getting "ERROR: Agent is unreachable via TCP" doing the test with JMeter in my local machine and the agent on the server (RedHat). I think is it because of VPN

    3. Hello, Normally you get the error "ERROR:" when there is no JRE in the server...Please make sure you have java runtime environment in the server machine as well...then you won't get there errors.!!

    4. Hi Anthony, thank you for your answer. Unfortunately didn't work. As I said before I'm able to telnet from my machine to the server. But when I try do it with Jmeter I'm getting this error: "ERROR: Agent is unreachable via TCP". In serverAgent on the server I'm getting :
      INFO 2014-06-25 23:41:53.156 [kg.apc.p] (): Yep, we received the 'test' command
      INFO 2014-06-25 23:41:53.586 [kg.apc.p] (): Closing TCP connection
      This is strange because the connection is establish but soon after it is closed.
      My guess is it because VPN. I think is needed change some jmeter properties in file to work with VPN but I don't know what to change. Can you help me?

  2. Awesome Artical Really i have searching this type of valuable information From a lot of days i found satisfaction when Read your blog Thanks for giving this type blog and also please Read link bvba Woodstone which provide information server monitoring & monitoring tools

  3. I'm using distributed testing meachanism using Jmeter. I'm running scripts on server, but script execution is taking place from local computer[using Remote Server option].

    Test Environment will like this,

    Scripts Triggering machine, from which script will be executed
    Load Balancer Node - Distribute the load on all the 5 servers.

    Where should I run the server agent on the above setup? Is it on all the server nodes 1-5?

    1. you need to run on the servers that you want to monitor.
      That means, if you are application server , run agent in application server.
      if you monitor jmeter slave servers, run agent in that server.

  4. We are using distributed mechanism for the performance tests using JMeter. We have plenty of automated scripts created to verify the performance of the application.

    Test Environment is configured like below,

    Scripts triggering Machine - used to run the scripts on the remote servers mentioned below.
    Load Balancer Server

    Where should i install server agent to monitor the performance of the servers[1-4]?

  5. Thanks. Should I need to run the server agent on Server1, Server2, Server3, Server4 to get the performance metrics?

  6. What setting do i need to change in ?

    I am getting Error :
    2016/04/28 12:38:30 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
    2016/04/28 12:38:30 INFO - kg.apc.jmeter.perfmon.PerfMonCollector: PerfMon metrics will be stored in C:\Users\snarayan\AppData\Local\Temp\perfmon_8231788921020883151.jtl
    2016/04/28 12:38:30 INFO - kg.apc.jmeter.perfmon.PerfMonCollector: Can't connect TCP transport for host: / Agent is unreachable via TCP
    at kg.apc.jmeter.perfmon.PerfMonCollector.getConnector(
    at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnector(
    at kg.apc.jmeter.perfmon.PerfMonCollector.initiateConnectors(
    at kg.apc.jmeter.perfmon.PerfMonCollector.testStarted(
    at org.apache.jmeter.reporters.ResultCollector.testStarted(
    at kg.apc.jmeter.vizualizers.CorrectedResultCollector.testStarted(
    at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(
    at Source)

    4449 port is open and i can connect it using telnet.
    not sure what the problem is .. can u help

    1. Problem is -> Agent is unreachable via TCP to

      Your setup was wrong for RMI. Setup RMI properly. your Jmeter cant connect perfmon agent.

  7. Hi,
    I am new to the Jmeter. Same problem here as well. I am able to connect to the server via telnet. but when running the Jmeter script, it says Connection to host lost and ERROR k.a.p.c.AbstractTransport: Error during exit Connection reset by peer: socket write error
    at Method) ~[?:?]
    at ~[?:?]
    at ~[?:?]
    at kg.apc.perfmon.client.StreamTransport.writeln( ~[perfmon-2.2.2.jar:?]
    at kg.apc.perfmon.client.AbstractTransport.disconnect( [perfmon-2.2.2.jar:?]
    at kg.apc.jmeter.perfmon.NewAgentConnector.disconnect( [jmeter-plugins-perfmon-2.1.jar:?]
    at kg.apc.jmeter.perfmon.PerfMonCollector.shutdownConnectors( [jmeter-plugins-perfmon-2.1.jar:?]
    at kg.apc.jmeter.perfmon.PerfMonCollector.testEnded( [jmeter-plugins-perfmon-2.1.jar:?]
    at org.apache.jmeter.reporters.ResultCollector.testEnded( [ApacheJMeter_core.jar:5.1 r1853635]
    at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd( [ApacheJMeter_core.jar:5.1 r1853635]
    at [ApacheJMeter_core.jar:5.1 r1853635]
    at [?:?]
    2019-05-03 17:29:54,793 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

    Appreciate if you can help me on this.
    Thank you