144 IBM Tivoli Monitoring V5.1.1 Implementation Certification Study Guide
The properties created or modified from the logging element automatically
update the SetDefaultConfiguration function, as shown in Example 8-5.
Example 8-5 Physicaldiskmodel logging element properties
' Logging definition section
'<<LOGGING_INFO>>
Svc.DefineLogInst “Bytes Transferred”, “PhysicalDisk”, “PhysicalDisk”,
“DiskBytesSec”, “PhysicalDisk”
Svc.DefineLogInst “Queue Length”, “PhysicalDisk”, “PhysicalDisk”,
“AvgQLength”, “PhysicalDisk”
Svc.DefineLogInst “Percent Disk Usage”, “PhysicalDisk”, “PhysicalDisk”,
“PercentDiskTime”, “PhysicalDisk”
'<<\LOGGING_INFO>>
8.3.6 Decision tree script of PhysicalDiskModel
As you have seen so far, PhysicalDiskModel is made up of four key components:
dynamic model elements, event elements, threshold elements, and logging
elements. We have been focusing on the three specific elements:
򐂰 The TMW_SlowPhysicalDrive event element
򐂰 The HighQueueLength threshold element
򐂰 The Percent Disk Usage_PhysicalDisk logging element
The PhysicalDiskModel decision tree script code ties these three elements
together. This is a Visual Basic script-based model that uses Microsoft’s WMI to
retrieve CIM data. WMI is Microsoft’s implementation of the CIM architecture on
Windows machines.
VisitTree in PhysicalDiskModel only generates indications and logs data. First
let’s look at how the TMW_SlowPhysicalDrive indication is sent to the event
aggregator.
PhysicalDiskModel collects data from the WMI Performance Monitoring Provider
(PerfProv). Most of the Windows-based resource models collect data from
PerfProv as well. In the dynamic model element of PhysicalDiskModel, all of the
properties that are defined are collected each cycle time before the VisitTree
function is called.
Note: The event aggregator is not in the decision tree code. It is part of the
IBM Tivoli Monitoring engine.
Chapter 8. IBM Tivoli Monitoring Workbench 145
The TMW_SlowPhysicalDrive indication is generated from the VisitTree function
when the CurrentDiskQLength and the DiskBytesSec exceed their threshold
values. The Percent Disk Usage_PhysicalDisk logging element is processed on
every cycle regardless of whether the threshold is met. Example 8-6 shows the
code for TMW_SlowPysicalDrive and the logging elements. It is an example of
the PhysicalDiskModel code and has been modified for the purposes of this
discussion.
Example 8-6 PhysicalDiskModel example VisitTree
1 Public Function VisitTree(Svc As Object) As Long
2 Dim numAvgQLength As Long, numCurrentDiskQLength As Long, numAvgReadQLength As Long
3 Dim numAvgWriteQLength As Long, bytDiskReadBytesSec As Long, bytDiskWriteBytesSec As Long
4 Dim numDiskReadsSec As Long, numDiskWritesSec As Long, numDiskXfersSec As Long
5 Dim numDiskBytesSec As Long, numPercentDiskTime As Long, numPercentDiskReadTime As Long
6 Dim numPercentDiskWriteTime As Long, numTotalDisks As Long, flagHighPhysicalQLength As Long
7 Dim flagHighPhysicalXferRate As Long, flagHighPhysicalReadRate As Long,
8 flagHighPhysicalWriteRate As Long
9 Dim flagHighPhysicalPercentTime As Long, i As Long
10 Dim strPhysicalDisk As String
11
12 i = 0
13
14 numTotalDisks = Svc.GETNUMOFINST(“TMW_PhysicalDisk”)
15
16 Do While i < numTotalDisks
17 flagHighPhysicalQLength = 0
18 flagHighPhysicalXferRate = 0
19 flagHighPhysicalReadRate = 0
20 flagHighPhysicalWriteRate = 0
21 flagHighPhysicalPercentTime = 0
22
23 strPhysicalDisk = Svc.GetStrProperty(“TMW_PhysicalDisk”, i, “PhysicalDisk”)
24
25 If strPhysicalDisk <> “_Total” Then
26 strPhysicalDisk = Mid$(strPhysicalDisk, 1, 1)
27 bytDiskReadBytesSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “DiskReadBytesSec”)
28 bytDiskWriteBytesSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i,
39 “DiskWriteBytesSec”)
30 numDiskReadsSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “DiskReadsSec”)
31 numDiskWritesSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “DiskWritesSec”)
32 numCurrentDiskQLength = Svc.GetNumProperty(“TMW_PhysicalDisk”, i,
33 “CurrentDiskQLength”)
34 numAvgQLength = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “AvgDiskQLength”)
35 numAvgReadQLength = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “AvgDiskReadQLength”)
36 numAvgWriteQLength = Svc.GetNumProperty(“TMW_PhysicalDisk”, i,
37 “AvgDiskWriteQLength”)
38 numDiskBytesSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “DiskBytesSec”)
39 bytDiskReadBytesSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “DiskReadBytesSec”)
146 IBM Tivoli Monitoring V5.1.1 Implementation Certification Study Guide
40 bytDiskWriteBytesSec = Svc.GetNumProperty(“TMW_PhysicalDisk”, i,
41 “DiskWriteBytesSec”)
42 numPercentDiskTime = Svc.GetNumProperty(“TMW_PhysicalDisk”, i, “PercentDiskTime”)
43 numPercentDiskReadTime = Svc.GetNumProperty(“TMW_PhysicalDisk”, i,
44 “PercentDiskReadTime”)
45 numPercentDiskWriteTime = Svc.GetNumProperty(“TMW_PhysicalDisk”, i,
46 “PercentDiskWriteTime”)
47
48 'Log instance data stuff
49 Svc.LogInst “Percent Disk Usage”, “PhysicalDisk”, numPercentDiskReadTime,
50 strPhysicalDisk
51 Svc.LogInst “Bytes Transferred”, “PhysicalDisk”, numDiskBytesSec, strPhysicalDisk
52 Svc.LogInst “Queue Length”, “PhysicalDisk”, numAvgQLength, strPhysicalDisk
53
54 If numCurrentDiskQLength > Svc.GetThreshold(“HighQLength”) Then
55 flagHighPhysicalQLength = 1
56 End If
57
58 If numDiskBytesSec > Svc.GetThreshold(“HighBytesSec”) Then
59 flagHighPhysicalXferRate = 1
60 End If
61
62 If bytDiskReadBytesSec > Svc.GetThreshold(“HighBytesSec”) Then
63 flagHighPhysicalReadRate = 1
64 End If
65
66 If bytDiskWriteBytesSec > Svc.GetThreshold(“HighBytesSec”) Then
67 flagHighPhysicalWriteRate = 1
68 End If
69
70 If numPercentDiskTime > Svc.GetThreshold(“HighPercentUsage”) Then
71 flagHighPhysicalPercentTime = 1
72 End If
73
74 If flagHighPhysicalQLength = 1 Then
75 If flagHighPhysicalXferRate = 1 Then
76 Svc.SENDEVENT “TMW_SlowPhysicalDrive”, _
77 numCurrentDiskQLength, _
78 numPercentDiskTime, _
79 numAvgQLength, _
80 numAvgReadQLength, _
81 numAvgWriteQLength, _
82 bytDiskReadBytesSec, _
83 bytDiskWriteBytesSec, _
84 strPhysicalDisk
85 Else
86
87 Some code deleted
88

Get IBM Tivoli Monitoring V5.1.1 Implementation Certification Study Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.