Forum Discussion

Antony_Hawkins's avatar
3 years ago

IIS Sites Listing PropertySource

This is a PowerShell-based PropertySource that will query Windows web servers (using Get-IISSite or Get-Website commands as appropriate to the version of Windows) and provide a list of names in a resource property 'auto.iis.sites':

Note this will not list the "Default Web Site", mostly because of the way Windows outputs the results and also because it doesn't mean much.

Why?

The main purpose of this PropertySource is to enable you to easily group IIS machines based on the sites they're running / supporting, to enable simpler construction of Service Insights, dashboards, etc.

What else could you do with this?

Well... you *could* then build an API script to create, or ensure existed, website monitors within LogicMonitor for each website that your various servers are running, rather than having to go figure out what those all are and manually construct them.

You could also create a DataSource to add HTTP/S monitoring of each site on that server, direct from the collector monitoring that host, as instances (similar to the HTTP_Page- DataSource). Caveat on that one, when I did a quick and dirty test of this, if the collector machine is running IIS, the results you get are from the collector monitoring itself, which means you get a 200 code for the IIS instance regardless of whether the domains you've told IIS about exist or not - i.e. it tells you nothing about whether the rest of the world might be able to access the sites. This is therefore potentially of "limited value", but it's a pretty easy thing to create if your IIS machines are not also your collector machines...

Note also on this (really important!), my PowerShell skill level is not particularly amazing, so while this works in most cases, I did notice it didn't pick up on the MS Exchange back end instances of IIS on a test machine. Someone else might be able to tweak this for better effect.

Will work locally and remotely; remote connection demands WinRM is enabled to allow the collector to connect and run the PS script block on the target server.

Version 1.3, Published with lmLocator: XRNW4X

No RepliesBe the first to reply