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.
300.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How to monitor active sessions / users for iis 7.0 ?

Votes:

0

Your Vote:

Up

Down

Is there are possibility to monitor the sessions / users that are currently active on a iis 7.0 webserver ?

iis sessions users

Created on Jul 14, 2011 7:56:08 AM by  Gebruiker (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 13 or later

Monitoring the Number of Current IIS Users

You can use the EXE/Script Advanced Sensor with the following PowerShell script to get just the total current users from IIS:

$computer = $args

$namespace = "root\CIMV2"
$userSessions = Get-wmiObject -class Win32_PerfRawData_W3SVC_WebService -computername $computer -namespace $namespace | select-object -expand currentanonymoususers

$users=$usersessions[0]

Write-Host "<prtg>"
"<result>" 
"<channel>Total Users connected to IIS</channel>" 
    
"<value>"+ $users +"</value>" 
"</result>"

"<text>Total of " + $users + " users connected</text>"
Write-Host "</prtg>"
  • Save the script file as NumberofConnections.ps1 into the /Custom Sensors/EXEXML sub-directory of the probe system's PRTG program directory.
  • Add the EXE/Script Advanced sensor to PRTG and select the created script in the sensor settings.
  • In the section Parameters, define %host or the host name of the device.
  • Make sure to use the Windows credentials of the parent device.

Alternatively, you can use the IISStatisticsXML Sensor from PRTG Tools Family which monitors several IIS statistics.

Created on Sep 4, 2013 11:54:04 AM by  Greg Campion [Paessler Support]

Last change on Aug 19, 2014 2:31:20 PM by  Gerald Schoch [Paessler Support]



9 Replies

Votes:

0

Your Vote:

Up

Down

Created on Jul 14, 2011 1:42:52 PM by  Patrick Hutter [Paessler Support] (7,225) 3 3



Votes:

0

Your Vote:

Up

Down

Custom Sensor PTF.IISStatisticsXML

will give you that and more....

Created on Jul 14, 2011 1:55:41 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,263) 3 4



Votes:

0

Your Vote:

Up

Down

Thank for the plugin.

But the plugin is not working for me, i get the message:

Access denied. Please check your Windows credentials. (code: PE095)

The credentials should be good, because i have configured: Use Windows credentials of parent device. And i have allready have working a few wmi sensors on this credenatials.

Created on Jul 15, 2011 9:18:13 AM by  Gebruiker (0) 1



Votes:

0

Your Vote:

Up

Down

I also use the credentials of the parent device and that works fine for me.

I do get the same error when I omit the domain name. Can you please check that you have entered the correct domain name at the parent device?

Created on Jul 18, 2011 9:07:36 AM by  PRTG Tools Family [prtgtoolsfamily.com] (13,263) 3 4



Votes:

0

Your Vote:

Up

Down

Yes we put the correct computer name on the parent device. If we remove this name the wmi sensors do not work anymore, so this is correct. Als disabled the firewall.

Does anyone has a other suggestion ?

Created on Jul 19, 2011 7:59:25 AM by  Gebruiker (0) 1



Votes:

0

Your Vote:

Up

Down

You can try entering username, password and domain name (not the computer name) on the sensor level, breaking the inheritance of the device settings.

Created on Jul 19, 2011 8:50:21 AM by  PRTG Tools Family [prtgtoolsfamily.com] (13,263) 3 4



Votes:

0

Your Vote:

Up

Down

I have checked this but i think this is not possible for a custum sensor. I don't have the option for "Interherit credentials for windows systems"

Created on Jul 19, 2011 10:10:00 AM by  Gebruiker (0) 1



Votes:

0

Your Vote:

Up

Down

If you send me your email address, I can send you some screenshots.

You can find my email address on the bottom left-hand corner of this page:

Use the "Send an email" link.

Created on Jul 19, 2011 2:43:33 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,263) 3 4



Accepted Answer

Votes:

0

Your Vote:

Up

Down

This article applies to PRTG Network Monitor 13 or later

Monitoring the Number of Current IIS Users

You can use the EXE/Script Advanced Sensor with the following PowerShell script to get just the total current users from IIS:

$computer = $args

$namespace = "root\CIMV2"
$userSessions = Get-wmiObject -class Win32_PerfRawData_W3SVC_WebService -computername $computer -namespace $namespace | select-object -expand currentanonymoususers

$users=$usersessions[0]

Write-Host "<prtg>"
"<result>" 
"<channel>Total Users connected to IIS</channel>" 
    
"<value>"+ $users +"</value>" 
"</result>"

"<text>Total of " + $users + " users connected</text>"
Write-Host "</prtg>"
  • Save the script file as NumberofConnections.ps1 into the /Custom Sensors/EXEXML sub-directory of the probe system's PRTG program directory.
  • Add the EXE/Script Advanced sensor to PRTG and select the created script in the sensor settings.
  • In the section Parameters, define %host or the host name of the device.
  • Make sure to use the Windows credentials of the parent device.

Alternatively, you can use the IISStatisticsXML Sensor from PRTG Tools Family which monitors several IIS statistics.

Created on Sep 4, 2013 11:54:04 AM by  Greg Campion [Paessler Support]

Last change on Aug 19, 2014 2:31:20 PM by  Gerald Schoch [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.