0

I have Jmeter serveragent running with sudo privileges [sudo ./startAgent.sh --interval 1] on my server where I am trying to collect IO Stats using EXEC metric screenshot attached

During the jmx run (GUI Mode for verification) the Server Agent throws error as below:

ERROR   2022-02-28 16:01:35.804 [kg.apc.p] (): Problems executing: iostat -d -z
java.io.IOException: Cannot run program "iostat -d -z": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at java.lang.Runtime.exec(Runtime.java:621)
        at java.lang.Runtime.exec(Runtime.java:486)
        at kg.apc.perfmon.metrics.ExecMetric.getValue(ExecMetric.java:31)
        at kg.apc.perfmon.PerfMonMetricGetter.getMetricsLine(PerfMonMetricGetter.java:113)
        at kg.apc.perfmon.PerfMonWorker.processSenders(PerfMonWorker.java:268)
        at kg.apc.perfmon.PerfMonWorker.run(PerfMonWorker.java:231)
        at java.lang.Thread.run(Thread.java:750)
Caused by: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
        at java.lang.ProcessImpl.start(ProcessImpl.java:134)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 7 more

The command works fine from the terminal. enter image description here

What could be wrong?

Xsudo
  • 29
  • 1
  • 5

1 Answers1

0

Perhaps your terminal has iostat utility in PATH and the session which is established by JMeter doesn't know where this iostat utility lives so try using which command to determine full path to the utility and amend your PerfMon Metrics collector to use the full path.

Also the command needs to exit and to supply single numeric value so you might want to amend the arguments accordingly.

More information: How to Monitor Your Server Health & Performance During a JMeter Load Test

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I'm able to get the command to work by modifying the metric parameter as : label=Disk IO:/bin/sh:-c:iostat -d -z Now in the serveragent console I do not see the reported error. It says "INFO 2022-02-28 17:02:36.722 [kg.apc.p] (): Starting measures: exec:/bin/sh:-c:iostat -d -z" but the Metrics collector in Jmeter is not recording anything yet. What you said "Also the command needs to exit and to supply single numeric value " makes sense. This is probably the reason why it is not recording anything. Any idea how I can prune this command to get a single numeric value? – Xsudo Feb 28 '22 at 11:39