Can I have my server send an email before it starts the Windows update process?
Details
We have a Virtual Private Server running several websites at a hosting company. The server is currently set up to automatically install updates. A couple of times over the last few months, the server has failed to restart after the Windows Update. I would like to be notified when an update is about to be applied so I can check up on the server shortly thereafter.
Server Info:
- VPS is running in Microsoft Virtual Server Enterprise Edition (I have no control over the host machine however)
- Windows Server 2003 Web Edition (32 bit)
Best Answer
The hanging during reboots is a very well known problem. I suggest changing the way the server does it's updates, especially not allowing it to reboot as part of the updating process. The method I've been using for a number of years with total reliability is:
Since implementing that system I've never had a server hang during a reboot. Prior to that at least one of the servers, sometimes more, would hang at few times a year.
In addition to the above I also have a batch file run as a machine startup script which emails me when the server reboots. I check me email first thing Sunday morning. If ever I don't have an email from each of the servers I know I have a problem, because either it didn't start the reboot or it didn't finish it. It doubles as a handy alert should a server ever reboot itself for any reason.
Update:
The install script I use (UpdateHF_v2.5.vbs) was created by Rob Dunn and is available from here. I have customised my copy slightly to suit my own needs.
The reboot batch file is:
The batch file which sends the reboot notification email is (private information removed):
I use blat but obviously you can use any command line email program you like.