This month's script, GroupedShutdowns, is dedicated to those hard-working systems administrators who've had to manually reboot all their servers in the middle of the night. Manually accessing the console on numerous servers can take time and cause mistakes. Even writing a script that performs the shutdown and restart via your favorite command-line tool can fail if nodes don't respond to the Shutdown command. A properly designed script can come to the rescue by making this repetitive task easier and the results accurate and verifiable.
The GroupedShutdowns script can help you manage a sequenced shutdown and restart of many nodes. You can use any of several available command-line tools to perform remote shutdowns and restarts. However, issuing shutdown/restart commands to your entire server environment simultaneously can cause some obvious problems. I've found that a two-tiered approach works best. Such an approach lets you shut down and restart clustered or load-balanced servers sequentially, so that resources remain online on at least one node throughout the reboot process. This method lets you reboot file or database servers first, then boot Web servers, which are dependent on file-server virtual directories or databases. . . .