What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

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

How to monitor active sessions / users for iis 7.0 ?

Votes:

0

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



Best Answer

Accepted Answer

Votes:

0

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

Custom Sensor PTF.IISStatisticsXML

will give you that and more....

Created on Jul 14, 2011 1:55:41 PM



Votes:

0

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



Votes:

0

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



Votes:

0

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



Votes:

0

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



Votes:

0

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



Votes:

0

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



Accepted Answer

Votes:

0

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]




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.