0

Running 08 windows server on a VM We need to be notified by email or by other means whenever the site is either 404 or goes to maintenance page. Therefore, we need the script to be constantly checking the site for errors.

When this occurs, we also need the IIS to restart itself using the script.

Since this runs on a server, we need it to execute once and keep on looping.

I need any sort of guidance as to where begin. I was dumped this project, with no prior experience on Powershell.

Thanks.

kaizen
  • 11
  • 1
    I would suggest leaning a bit about powershell first. this isn't a complicated script but I wouldn't want to encourage you to run a script you don't understand on a public facing webserver. See https://technet.microsoft.com/en-us/scriptcenter/dd742419 for a starting point – Jim B Feb 04 '15 at 23:49

1 Answers1

2

Typically that is called monitoring and is something you don't do from the server itself (dead servers have typically great difficulty announcing their own deaths) but from second host.

Many monitoring systems have agents that can be installed on the servers that are being monitored and which can be called to attempt a service restart automatically as first aid, and only when that fails a notification is sent to whoever is on pager duty.

Don't try to reinvent the wheel.

HBruijn
  • 77,029
  • 24
  • 135
  • 201
  • dead servers don't serve pages at all and is not the ask. This is a very common ask, since most of the time you wouldn't want to buy/build a monitoring solution for a simple page check. Don't buy a railroad for a 3 minute walk. – Jim B Feb 04 '15 at 23:53
  • Well we dont want an outside service to let us when know when the server is down. We just need to know when the site is down, considering how IIS is the issue. Not the server. – kaizen Feb 05 '15 at 00:24
  • @kaizen think long term for a bit here. You may be having problems with IIS today, but a full monitoring system will be able to help you with your Out of memory issues, or disk full issues tomorrow. You don't have to use an external services to monitor IIS. There are many fine monitoring systems that you can run within your network. – Zoredache Feb 05 '15 at 00:51