What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

WMI returns different data than System Monitor

Votes:

0

Your Vote:

Up

Down

I am using WMI to obtain performance data. I want to know how many requests per second are entering into the IIS. I am using the “WebService” object and the “Total methods requests per sec” performance counter.

I have created a script in VB in order to obtain the data from Win32_PerfFormattedData_W3SVC_WebService.TotalMethodRequestsPerSec. I have a custom sensor that executes that script every 30 seconds.

I made several tests and I don’t know why I receive different results depending on having the counter running in the System Monitor or not. It seems that there is some kind of interaction with the System Monitor and I would like someone to explain me why this is happening.

The servers where I performed the tests are receiving an average of 200 requests per second all day long.

The script does the following process: • Refresh the counter. • Wait a second. • Refresh the counter again. • Read the counter data.

If I execute the script every 30 seconds without the “System Monitor” running, it returns values in the range of 1200 - 1600 requests per second. If I open the “System Monitor” and load the same counter, the script retrieves values in the range of 180-200 requests per second. In this last case, the script and the “System Monitor” show the same values. If I close the “System Monitor” and I execute the script again, it starts to return bigger values like at the beginning.

Does anyone have any idea about this behavior?

This is the script:

Set colitems = _
    objRefresher.AddEnum(objWMIService, _
    "Win32_PerfFormattedData_W3SVC_WebService").objectSet

objRefresher.Refresh

Wscript.Sleep 1000

objRefresher.Refresh

for each objitem in colitems
	if objItem.Name="_Total" then
		WScript.echo objItem.TotalMethodRequestsPersec & ":OK"
	end if
next

Thanks in advance.

custom-sensor prtg wmi

Created on Feb 7, 2012 11:56:26 AM by  hermes (0) 1

Last change on Feb 7, 2012 4:08:45 PM by  Torsten Lindner [Paessler Support]



2 Replies

Votes:

0

Your Vote:

Up

Down

I made some more tests modifing the script: if I read the counter value twice in one second intervals each time the script runs, the first value is about 1200 - 1600, but the second value is about 200. The script always runs in 30 seconds intervals.

Why the script returns the same value as the system monitor the second time it reads the counter, and not the first time?

Why the script does not return the same values as the system monitor when the system monitor is closed?

Created on Feb 15, 2012 9:36:40 AM by  hermes (0) 1



Votes:

0

Your Vote:

Up

Down

I think it might be better to send these questions to Microsoft.

Created on Feb 15, 2012 3:51:30 PM by  Torsten Lindner [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.