0

I have setup server monitoring in a JMeter test. The setup is very similar to the one in this stackoverflow answer. When I am collecting CPU or memory without specifying a process, everything works as expected. I see the graphs with correct metrics.

However, when I try to collect CPU per process, for example with metric parameter pid=8948:percent, the graph is empty, no samples are collected and I see the following exception on the monitored server:

ERROR   2018-04-03 13:17:14.607 [kg.apc.p] (): Error getting metric
org.hyperic.sigar.SigarPermissionDeniedException: Access is denied.
: 8948
        at org.hyperic.sigar.SigarProxyCache.invoke(SigarProxyCache.java:218)
        at com.sun.proxy.$Proxy0.getProcCpu(Unknown Source)
        at kg.apc.perfmon.metrics.CPUProcMetric.getValue(CPUProcMetric.java:35)
        at kg.apc.perfmon.PerfMonMetricGetter.getMetricsLine(PerfMonMetricGetter
.java:114)
        at kg.apc.perfmon.PerfMonWorker.processSenders(PerfMonWorker.java:280)
        at kg.apc.perfmon.PerfMonWorker.run(PerfMonWorker.java:243)
        at java.lang.Thread.run(Unknown Source)

I tried getting the process by name, but the exception is the same. I run startAgent.bat --sysinfo and indeed the user has no rights on the process w3wp.exe (8948) that I want to monitor (The user does not "see" this process).

The documentation states explicitly that I do not need admin rights on the application server (Windows Server 2012 R2). The user already has Performance Monitor Users and Performance Log Users role.

So how can I monitor CPU per process in a JMeter test with user that is not an administrator on the application server?

K. B.
  • 3,342
  • 3
  • 19
  • 32

1 Answers1

1

You can work this around by running Server Agent with elevated privileges, it could be done in 2 ways:

  1. Using psexec tool you can run a process with SYSTEM account rights

    PSExec become system

  2. Using Task Scheduler you also have possibility to start process with the highest privileges

    JMeter Task Scheduler

Given you run Server Agent with elevated rights - you should be able to collect CPU metrics for IIS process.

See How to Monitor Your Server Health & Performance During a JMeter Load Test article for more information on using PerfMon Metrics Collector and Server Agent.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133