So I have a couple of IIS servers that I want to monitor for website uptimes. I can't do a heartbeat to them for a couple of reasons so instead I'd like to check the IIS sites. I've looked at the embedded scripts and although the iis_list_stopped_w3svc_sites.vbs script does work, it checks for all sites on the server. Some of the sites are stopped for testing and I only have a few that I need to monitor. I've also grabbed the checkurl tool and tested that but it seems that knowing if the site is up or down would be better.
My VB scripting is rusty, so I went a slightly different way to create a new script. The rough draft of the batch file is
this ($site is a variable for whatever site I want to look at. Removed for privacy.)
iisweb /query $site>IIS_log.txt
type "IIS_log.txt" | find "%string%" > nul
if ErrorLevel 1 (
) else (
eventcreate /ID 400 /L APPLICATION /T ERROR /SO IIS_UPTIME /D "$site is stopped"
What I'd like to know is if there might be a better way to monitor a specific website from the inside of the network?