DHCP, Task: Capture DHCP server system load and utilization statistics

Task: Capture DHCP server system load and utilization statistics in DHCP Operations Guide

Task: Capture DHCP server system load and utilization statistics

Purpose

The following activity captures empirical data on the DHCP server. This data, which is collected daily (or multiple times a day) should be reviewed weekly. It will also be used to create monthly reports that are reviewed quarterly for SLA/OLA compliance. Server utilization statistics are different from service metrics in that they measure the usage characteristics of the underlying infrastructure of the DHCP server system, such as disk, memory, or processor, and not necessarily the DHCP service itself.

 

Procedure 1: Configure DHCP server system load and utilization logging using performance logs and alerts console

This procedure configures the Windows Server 2003 logging facility to collect DHCP server system load and utilization information. Although listed as a daily schedule, this procedure needs to be executed only once, since the logging facility is automated and will continue to collect until stopped.

1. On the Start menu, click Run and type perfmon.msc

2. In the left tree view, expand the Performance Logs and Alerts branch, and click Counter Logs. The pane on the right will display all log settings.

3. Right-click Counter Logs, and select New Log Settings.

4. Enter a name, such as “DHCP Server Load and Util” and click OK.

5. Click the Add Counter button; this will bring up the Add Counter dialog box.

6. In the Select counters from computer: pull-down box, verify that the DHCP server is listed.

7. Verify that the Select counters from list: radio button is selected.

8. In the Performance Object pull-down menu, select Logical Disk.

9. Click Free Megabytes from the counters, and choose the appropriate drive where the DHCP database is housed. The default for DHCP is “C:”

10. Click Add.

11. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

12. In the Performance Object pull-down menu, select Logical Disk.

13. Click %Free Space from the counters, and choose the appropriate drive where the DHCP database is housed. Default for DHCP is “C:”

14. Click Add.

15. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

16. In the Performance Object pull-down menu, select Logical Disk.

17. Click %Disk Time from the counters, and choose the appropriate drive where the DHCP database is housed. The default for DHCP is “C:”

18. Click Add.

19. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

20. In the Performance Object pull-down menu, select Physical Disk.

21. Click Disk Reads/sec from the counters, and choose the appropriate drive where the DHCP database is housed. The default for DHCP is “C:”

22. Click Add.

23. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

24. In the Performance Object pull-down menu, select Physical Disk.

25. Click Disk Writes/sec from the counters, and choose the appropriate drive where the DHCP database is housed. The default for DHCP is “C:”

26. Click Add.

27. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

28. In the Performance Object pull-down menu, select Memory.

29. Click Available MBytes from the counters, and click Add.

30. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

40. In the Performance Object pull-down menu, select Memory.

41. Click Page Faults/sec from the counters, and click Add.

42. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

43. In the Performance Object pull-down menu, select Paging File.

44. Click %Usage from the counters, and choose _Total on Select instances from list.

45. Click Add.

46. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

47. In the Performance Object pull-down menu, select Processor.

48. Click %DPC Time from the counters, and choose _Total on Select instances from list.

49. Click Add.

50. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

51. In the Performance Object pull-down menu, select Processor.

52. Click %Processor Time from the counters, and choose _Total on Select instances from list.

53. Click Add.

54. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

55. In the Performance Object pull-down menu, select Processor.

56. Click Interrupts/sec from the counters, and choose _Total on Select instances from list.

57. Click Add.

58. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

59. In the Performance Object pull-down menu, select Processor.

60. Click Interrupts/sec from the counters, and choose _Total on Select instances from list.

61. Click Add.

62. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

63. In the Performance Object pull-down menu, select Server.

64. Click Bytes Total/sec from the counters, and click Add.

65. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

66. In the Performance Object pull-down menu, select Server.

67. Click Work Item Shortages from the counters, and click Add.

68. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

69. In the Performance Object pull-down menu, select System.

70. Click Context Switches/sec, and click Add.

71. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

72. In the Performance Object pull-down menu, select System.

73. Click Processor Queue Length, and click Add.

74. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

75. In the Performance Object pull-down menu, select System.

76. Click System Up Time, and click Add.

77. Verify that the new counter was added to the logging.

(The Add Counters window may be blocking the previous DHCP Server Load and Util window.)

78. In the Sample data every: area, specify an appropriate interval, such as 10 minutes.

79. Select the Log Files tab on this window.

80. In Log file type: select Text File (Comma delimited), and click Configure.

81. Specify the appropriate location for the log file. Ideally, this should be a remote directory from a reliable file server with ample disk space to store three to five months' worth of DHCP server system load and utility logs.

82. In the File name: enter an appropriate name such as “DHCPSysUtil” and verify that the log file size is set to Maximum limit. Click OK.

83. Enable End File names with: and select [yyyymmdd] in the pull-down selector.

84. Add an appropriate comment, such as “DHCP System Perf and Util Log v1.”

85. Click Apply, and then click OK.

 

Procedure 2: Enable DHCP server system load and utilization logging using performance logs and alerts console

1. Right-click the newly created Counter Log from Procedure 1, and select Start.

2. Copy and paste the script below to Notepad.exe and save to a file such as “DHCPSysUtil.vbs.” The script illustrates the collection of server system load and utilization information similar to Procedure 1 above. This script does not continuously collect and store formatted performance information, but serves as a sample base for writing an operations script that may be integrated with an enterprise Management Pack.

 

3. Run the script by typing the following command:

cscript //nologo DHCPSysUtil.vbs
Script listing:
rem – DHCP Server System Load and Utilization Basic Collector ---------------------
On Error Resume Next 
rem ---------------------------------------------------------------------------------
rem -- List all DHCP Servers in the strDHCPServer array in quotes
rem -- and separated by commas. use "." for localsystem.
rem --
rem -- Example:
rem -- strDHCPServer=array("dhcpsvr01","dchpsvr02","192.168.23.21")
rem --
arrDHCPSvr = array( ".","dhcpsvr01")	
rem ---------------------------------------------------------------------------------
For Each strComputer in arrDHCPsvr
Wscript.Echo “ - “ & strComputer & “------------------------------“
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfDisk_LogicalDisk",,48)
For Each objItem in colItems
Wscript.Echo "CurrentDiskQueueLength: " & objItem.CurrentDiskQueueLength
Wscript.Echo "DiskReadsPersec: " & objItem.DiskReadsPersec
Wscript.Echo "DiskWritesPersec: " & objItem.DiskWritesPersec
Wscript.Echo "FreeMegabytes: " & objItem.FreeMegabytes
Wscript.Echo "PercentDiskTime: " & objItem.PercentDiskTime
Wscript.Echo "PercentFreeSpace: " & objItem.PercentFreeSpace
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfOS_Memory",,48)
For Each objItem in colItems
Wscript.Echo "AvailableMBytes: " & objItem.AvailableMBytes
Wscript.Echo "PageFaultsPersec: " & objItem.PageFaultsPersec
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfOS_PagingFile",,48)
For Each objItem in colItems
Wscript.Echo "PercentUsage: " & objItem.PercentUsage
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfOS_Processor",,48)
For Each objItem in colItems
Wscript.Echo "InterruptsPersec: " & objItem.InterruptsPersec
Wscript.Echo "PercentDPCTime: " & objItem.PercentDPCTime
Wscript.Echo "PercentProcessorTime: " & objItem.PercentProcessorTime
Next
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfNet_Server",,48)
For Each objItem in colItems
Wscript.Echo "BytesTotalPersec: " & objItem.BytesTotalPersec
Wscript.Echo "WorkItemShortages: " & objItem.WorkItemShortages
Next
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfNet_ServerWorkQueues",,48)
For Each objItem in colItems
Wscript.Echo "QueueLength: " & objItem.QueueLength
Next

Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfRawData_PerfOS_System",,48)
For Each objItem in colItems
Wscript.Echo "ContextSwitchesPersec: " & objItem.ContextSwitchesPersec
Wscript.Echo "ProcessorQueueLength: " & objItem.ProcessorQueueLength
Wscript.Echo "SystemUpTime: " & objItem.SystemUpTime
Next
Next
rem – END OF SCRIPT –

4. To format the script similar to the PerfMon format:

a. At the top of the script add the following lines:

m=Month(Now)
d=Day(Now)
s=Second(Now)
If (m<10) Then
m="0" & m
End If
If (d<10) Then
d="0" & d
End If
If (s<10) Then
s="0" & s
End If
strFormattedDate = chr(34) & m & "/" & d & "/" & Year(Now) & " " & Hour(Now) & ":" & Minute(Now) & ":" & s & ".000" & chr(34)

b. After the line “For Each objItem in colItems” all the way to “Next” are the output commands to echo the results to the screen. Select the objects you would like to log, and replace the “Wscript.Echo …” lines with one concatenated and formatted output including formatting such as “ (quotes) represented by chr(34) and , (commas).
For example, to create a PerfMon-style output for DHCP Nacks/sec, Offers/sec, and Requests/sec, the result would be:


For Each objItem in colItems
Wscript.Echo strFormattedDate & “,” & chr(34) & objItem.NacksPersec & chr(34) & “,” & chr(34) & objItem.OffersPersec & chr(34) & “,” & chr(34) & objItem.RequestsPersec & chr(34)
Next

c. Because multiple queries are required to fetch information from different criteria (such as Memory, Disk, Processor), this sample script shows multiple “For Each” loops. In order to capture all the various metrics into one PerfMon-style log line, the script may require additional tuning, such as assigning the result into a variable and printing the final line at the end. For example:


For Each obj Item in colItems
valNetwk01= chr(34) & objItem.NacksPersec & chr(34)
valNetwk02= chr(34) & objItem.OffersPersec & chr(34)

Next

For Each obj Item in colItems
valSvc01= chr(34) & RequestsPersec & chr(34)

Next

Wscript.Echo strFormattedDate & “,” & valNetwk01 & “,” & valNetwk02 & “,” & valSvc01

Dependencies

None

Technology Required

  • WMI infrastructure
  • Windows Script Host
  • Base DHCP Windows Server 2003

Optimizing Quadrant

Capacity Management SMF

Infrastructure Role Cluster

Monthly