Recipe 15.7 Viewing DNS Server Performance Statistics

15.7.1 Problem

You want to view DNS Server performance statistics.

15.7.2 Solution

15.7.2.1 Using a graphical user interface
  1. Open the Performance Monitor.

  2. Click on System Monitor in the left pane.

  3. In the right pane, click the + button. This will bring up the page to add counters.

  4. Under Select counters from computer, enter the DNS server you want to target.

  5. Select the DNS performance object.

  6. Select the counters you want to add and click the Add button.

  7. Click Close.

15.7.2.2 Using a command-line interface
> dnscmd <DNSServerName> /statistics
15.7.2.3 Using VBScript
' This code displays all statistics for the specified DNS server ' ------ SCRIPT CONFIGURATION ------ strServer = "<DNSServerName>"   ' e.g. dc1.rallencorp.com ' ------ END CONFIGURATION --------- set objDNS = GetObject("winmgmts:\\" & strServer & "\root\MicrosoftDNS") set objDNSServer = objDNS.Get("MicrosoftDNS_Server.Name="".""") set objStats = objDNS.ExecQuery("Select * from MicrosoftDNS_Statistic ") for each objStat in objStats    WScript.Echo " " & objStat.Name & " : " & objStat.Value next

15.7.3 Discussion

The Microsoft DNS Server keeps track of dozens of performance metrics. These metrics include the number of queries, updates, transfers, directory reads, and directory writes processed by the server. If you can pump these metrics into an enterprise management system, you can track DNS usage and growth over time.

These statistics can also be useful to troubleshoot load-related issues. If you suspect a DNS Server is being overwhelmed with DNS update requests, you can look at the Dynamic Update Received/sec counter and see if it is processing an unusually high number of updates.

15.7.3.1 Using a command-line interface

You can obtain a subset of the statistics by providing a "statid" after the /statistics option. Each statistics category has an associated number (i.e., statid). For a complete list of categories and their statid, run the following command:

> dnscmd /statistics /?

Here is an example of viewing the Query (statid = 2) and Query2 (statid = 4) statistics:

> dnscmd /statistics 6 DNS Server . statistics: Queries and Responses: ---------------------- Total:     Queries Received =      14902     Responses Sent   =      12900 UDP:     Queries Recvd    =      14718     Responses Sent   =      12716     Queries Sent     =      23762     Responses Recvd  =          0 TCP:     Client Connects  =        184     Queries Recvd    =        184     Responses Sent   =        184     Queries Sent     =          0     Responses Recvd  =          0 Queries: -------- Total          =      14902     Notify     =          0     Update     =       2207     TKeyNego   =        184     Standard   =      12511        A       =       1286        NS      =         29        SOA     =       2263        MX      =          0        PTR     =          1        SRV     =       8909        ALL     =          0        IXFR    =          0        AXFR    =          0        OTHER   =         23 Command completed successfully.
15.7.3.2 Using VBScript

You can obtain a subset of statistics by adding a where clause to the WQL query. The following query would match only counters that start with "Records":

select * from MicrosoftDNS_Statistic where Name like 'Records%'

15.7.4 See Also

MSDN: MicrosoftDNS_Statistic



Active Directory Cookbook
Active Directory Cookbook, 3rd Edition
ISBN: 0596521103
EAN: 2147483647
Year: 2006
Pages: 456

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