次の方法で共有


Add counters to a log

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

To add counters to a log

  • Using the Windows interface

  • Using a command line

Using the Windows interface

  1. Open Performance.

  2. Double-click Performance Logs and Alerts, and then click Counter Logs.

  3. In the details pane, double-click the log you want to modify.

  4. On the General tab, click Add Counters. For each counter or group of counters that you want to add to the log, perform the following steps:

    • To log counters from the computer on which the Performance Logs and Alerts service will run, click Use local computer counters.

      Or, to log counters from a specific computer regardless of where the service is run, click Select counters from computer and specify the Universal Naming Convention (UNC) name, such as \\MyLogServer, of the computer you want to monitor.

    • In Performance object, select an object to monitor.

    • In Select counters from list, click one or more counters to monitor.

    • To monitor all instances of the selected counters, click All Instances. (Binary logs can include instances that are not available at log startup but subsequently become available.)

      Or, to monitor particular instances of the selected counters, click Select Instances From List, and then click an instance or instances to monitor.

    • Click Add.

    • When you are finished adding counters, click Close.

Notes

  • To perform this procedure, you must be a member of the Administrators group, or the Performance Log Users group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open Performance, click Start, click Control Panel, double-click Administrative Tools, and then double-click Performance.

  • When creating a monitoring console for export, make sure to select Use local computer counters. Otherwise, counter logs will obtain data from the computer named in the text box, regardless of where the console file is installed.

  • For a description of a counter, click the counter in Performance counters and then click Explain.

  • Some object types have several instances. For example, if a system has multiple processors, the Processor object type will have multiple instances. The PhysicalDisk object type has two instances if a system has two disks. Some object types, such as Memory and Server, have only a single instance. If an object type has multiple instances, you can add counters to track statistics for each instance, or in many cases, for all instances at once. By default, counters are shown with both the instance name and an instance index. To turn off this feature, right-click the System Monitor graph, click Properties, and click the General tab.

  • When you specify the name of a remote computer using Select counters from computer, only the name of the local computer and those computer names entered during the current Performance session are listed. Computer names entered in previous sessions will not be listed.

Using a command line

  1. Open Command Prompt

  2. Type:

    logman update collection_name -c {path [path...]} | {-cffilename}

Value Description

update collection_name

Updates the collection query named collection_name. For counter collections, modifications to the query will stop, and then restart the collections.

-c {path [path...]} |  -cf {filename}

Specifies the performance counter path to log (path), or specifies the path name of the log file that lists these counters (-cffilename). To list multiple counter paths, separate the command line by a space, or use the -cf option to list counter paths in an input file, one per line. Use this format [\\computer]\object[instance]\counter] for each counter path where:

Computer is the optional computer name or the IP address of a remote computer. If a computer name is not supplied, the local computer will be used by default.

Object is the performance counter object (process or memory).

Instance (if any) is the performance object (process).

Counter is the performance counter for the object (processor time).

Note

  • An asterisk (*) can be used as a wild card when specifying the counter path. For example, to specify all instances of the % Processor Time, use "\Processor(*)\% Processor Time".

For example, to add all instances of the % Interrupt Time to the collection query named perf_log on computer \\COMP1, type:

logman update perf_log -c "\\COMP1\Processor(*)\% Interrupt Time"

Notes

  • To perform this procedure, you must be a member of the Administrators group, or the Performance Log Users group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure. For more information, see Default local groups, Default groups, and Using Run as.

  • To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.

  • To view the complete syntax for this command, at a command prompt, type:

    logman /?

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Concepts

Define start or stop parameters for a log or alert
Set parameters for a log
Remove counters from a log or alert
Logman