Is it possible to have a sensor monitor the number of IIS sessions connected to a specific site on a shared IIS 6/7 webserver?
IIS Sessions/Connections with Network Monitor
Votes:
0
Best Answer
Votes:
0
This article applies to PRTG Network Monitor 13 or later
Monitoring Sessions per Specific Sites
As an alternative to the approaches described below, you can also try using this script to get the results of the IIS sessions:
$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>"
The line $users=$usersessions[0] can be edited to use other instances of your IIS server. If you use the WMI tester, run the query
SELECT name,currentanonymoususers FROM Win32_PerfRawData_W3SVC_WebService
You will see all of the IIS instances along with their current user value and can then change your array selection in the code accordingly.
For example if the WMI tester comes back with
Then you could change the line $users=$usersessions[0] to $users=$usersessions[1] for Default Site or $users=$usersessions[2] for the OpenMan site.
Created on Sep 11, 2013 2:06:28 PM by
Greg Campion [Paessler Support]
Last change on Sep 11, 2013 3:31:25 PM by
Gerald Schoch [Paessler Support]
7 Replies
Votes:
0
You can monitor the current connections and current authenticated users with SNMP.
Simply run a detailed auto discovery on the server device.
The sessions per specific site can not be monitored.
Created on Mar 1, 2010 8:53:22 AM by
Aurelio Lombardi [Paessler Support]
Last change on Mar 1, 2010 9:10:13 AM by
Daniel Zobel [Product Manager]
Votes:
0
This seems to work on my Windows Server 2003 servers running IIS 6. I tried to clone this and run it against another server running Windows Server 2008 R2 running IIS 7.5 and this fails.
Any ideas?
Votes:
0
is SNMP enabled on the 2008R2 server?
the IIs sensors are SNMP sensors.
Votes:
0
Hmm I dunno why I missed that! Thanks. Its working well now.
Votes:
0
Try using OID 1.3.6.1.4.1.311.1.7.3.1.13.0
Votes:
0
Having the same issue as mr. singh.
prtg not picking up anything but the basic sensors on server 2008 R2. I've been through SNMP configs in prtg and server/firewall. imported latest iis mib's - snmp tester not connecting
Votes:
0
This article applies to PRTG Network Monitor 13 or later
Monitoring Sessions per Specific Sites
As an alternative to the approaches described below, you can also try using this script to get the results of the IIS sessions:
$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>"
The line $users=$usersessions[0] can be edited to use other instances of your IIS server. If you use the WMI tester, run the query
SELECT name,currentanonymoususers FROM Win32_PerfRawData_W3SVC_WebService
You will see all of the IIS instances along with their current user value and can then change your array selection in the code accordingly.
For example if the WMI tester comes back with
Then you could change the line $users=$usersessions[0] to $users=$usersessions[1] for Default Site or $users=$usersessions[2] for the OpenMan site.
Created on Sep 11, 2013 2:06:28 PM by
Greg Campion [Paessler Support]
Last change on Sep 11, 2013 3:31:25 PM by
Gerald Schoch [Paessler Support]
Add comment