Recipe2.15.Configuring System Failure Options


Recipe 2.15. Configuring System Failure Options

Problem

You want to configure what happens when a server encounters a critical failure and crashes.

Solution

Using a graphical user interface

  1. From the Control Panel, open the System applet.

  2. Select the Advanced tab.

  3. Under Startup and Recovery, click the Settings button.

  4. All of the system failure options are located under the System Failure heading. Modify the settings as necessary.

  5. Click OK until all of the windows are closed.

Using a command-line interface

The system failure and recovery options are stored in the registry. You can view the current settings by enumerating the HKLM\SYSTEM\CurrentControlSet\Control\CrashControl subkey:

> reg query \\<ServerName>\HKLM\SYSTEM\CurrentControlSet\Control\CrashControl

On Windows Server 2003, you can also use the wmic utility to view these settings:

> wmic /node:<ServerName> recoveros list /format:list

To modify these settings, use either the reg add command (on Windows 2000) or the wmic command (on Windows Server 2003). Next, I'll show some examples using wmic.

To disable admin alerts after failure, do the following:

> wmic recoveros set SendAdminAlert = False

To disable automatic reboot after failure, do the following:

> wmic recoveros set AutoReboot = False

To not write any information to a memory dump file after failure, do the following:

> wmic recoveros set DebugInfoType = 0

To set the mini-dump directory to d:\minidumps (only available with Windows Server 2003), do the following:

> wmic recoveros set MiniDumpDirectory = d:\minidumps

To set the location of the dump file to D:\Dump\Mem.dmp, do the following:

> wmic recoveros set DebugFilePath = D:\Dump\Mem.dmp

To not overwrite an existing dump file, do the following:

> wmic recoveros set OverwriteExistingDebugFile = 0

Using VBScript
' This code displays the current failure and recovery settings. ' ------ SCRIPT CONFIGURATION ------  strComputer = "."  ' e.g., rallen-srv01 ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colRecoveryConfig = objWMI.InstancesOf("Win32_OSRecoveryConfiguration") for each objConfig in colRecoveryConfig     Wscript.Echo objConfig.Name     Wscript.Echo "  Auto reboot: " & objConfig.AutoReboot     Wscript.Echo "  Debug File Path: " & objConfig.DebugFilePath     Wscript.Echo "  Debug Type: " & objConfig.DebugInfoType     Wscript.Echo "  Expanded Debug File Path: " & objConfig.ExpandedDebugFilePath     Wscript.Echo "  Kernel Dump Only: " & objConfig.KernelDumpOnly     Wscript.Echo "  Overwrite Existing: " & objConfig.OverwriteExistingDebugFile     Wscript.Echo "  Send Admin Alert: " & objConfig.SendAdminAlert     Wscript.Echo "  Write Debug Info: " & objConfig.WriteDebugInfo     Wscript.Echo "  Write to System Log: " & objConfig.WriteToSystemLog next ' This code modifies the system failure and recovery settings. ' ------ SCRIPT CONFIGURATION ------ strComputer = "."  ' e.g., rallen-srv01 ' ------ END CONFIGURATION --------- set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") set colRecoveryConfig = objWMI.InstancesOf("Win32_OSRecoveryConfiguration") for each objConfig in colRecoveryConfig     Wscript.Echo objConfig.Name        ' Uncomment the settings you want to modify:     ' objConfig.AutoReboot = True     ' objConfig.DebugFilePath = "d:\dumps\memory.dmp"     ' objConfig.DebugInfoType = 1  ' Only available on W2K3     ' objConfig.KernelDumpOnly = False     ' objConfig.MiniDumpDirectory = "d:\minidumps" ' Only available on W2K3     ' objConfig.OverwriteExistingDebugFile = True     ' objConfig.SendAdminAlert = True     ' objConfig.WriteDebugInfo = True     ' objConfig.WriteToSystemLog = True         objConfig.Put_ next WScript.Echo "Successfully modified settings."

Discussion

Microsoft operating systems have had a reputation for frequent crashes, which can cause the system to freeze and become unusable until it is rebooted. A crash is sometimes referred to as a system failure, bug check, stop error, or blue screen of death (for the blue screen that is displayed after the crash). System failures were especially common in the days of Windows 3.51 and Windows 9x. Fortunately, Microsoft has steadily improved in this area and now Windows 2000 and Windows Server 2003 are two of the most stable operating systems available. Nevertheless, Microsoft hasn't been able to completely rid itself of occasional crashes due to bugs in the OS or bad third-party drivers.

There are several settings you can configure to control what happens after a system crash. By default, when a system crashes, it writes the contents of memory to a debug file in the system root called memory.dmp. This file will be one of the first things Microsoft asks for if you open a support case about the crash (see MS KB 314103 for more information). After the debug file is written, an event is written to the System Event log and, if configured, an administrative alert is sent to the administrator of the system. See MS KB 310490 for more on configuring administrative alerts. Lastly, the system automatically reboots. You may want to give some thought about this last option because I've seen more than one case where a system continuously reboots itself because it experienced the failure during system startup. Also, if you automatically reboot and are not closely monitoring your systems, there could be sporadic undetected crashes.

Table 2-3 lists all of the system failure options and their corresponding graphical, registry, WMIC, and WMI settings.

Table 2-3. System failure settings

Graphical interface

Registry value

WMIC and WMI property

Description

Automatically restart

AutoReboot

AutoReboot

Determines if system automatically reboots after a system crash. The default is true.

Dump file

DumpFile

DebugFilePath

Path to the debug (or dump) file. The default is %SystemRoot%\MEMORY.DMP.

Write debugging information

CrashDumpEnabled

DebugInfoType

Determines if debug information is written to the debug file after a system crash. Values include: 0 (none), 1 (complete), 2 (kernel memory), and 3 (small memory). The default is 1. This setting is new in Windows Server 2003.

Write debugging information

KernelDumpOnly

KernelDumpOnly

This setting is deprecated in favor of DebugInfoType.

Small dump directory

MinidumpDir

MiniDumpDirectory

Path to the directory where the small memory dump file will be stored. The default is %SystemRoot%\MiniDump.

Overwrite any existing file

Overwrite

OverwriteExistingDebugFile

Determines if an existing debug file will be overwritten. If true (the default), then overwrite the debug file if it already exists. If false, then do not write a debug file if one already exists.

Send an administrative alert

SendAlert

SendAdminAlert

Determines if an administrative alert will be sent to the administrator after a system crash. If true (the default), an alert will be sent. If false, an alert will not be sent.

N/A

N/A

WriteDebugInfo

This setting is deprecated in favor of DebugInfoType.

Write an event to the system log

LogEvent

WriteToSystemLog

Determines if an event will be written to the System event log. If true (the default), an event is written. If false, an event is not written. This feature cannot be turned off on Windows 2000 Server or Windows Server 2003.


See Also

MS KB 307973 (HOW TO: Configure System Failure and Recovery Options in Windows), MS KB 310490 (HOW TO: Set Up Administrative Alerts in Windows XP), and MS KB 314103 (Preparation Before You Contact Microsoft After Receiving a STOP Message on a Blue Screen)



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net