IBM Tivoli Software IBM Tivoli Software

[ Bottom of Page | Previous Page | Next Page | Contents | Index ]


Dynamic Model

The following methods help you to express functions for dynamic model configuration.

Method DefineClass

Syntax
Object.DefineClass(Source As String, ClassName As String,_ 
RealClassName As String, WhereClause As String,_ 
NumProps As String, StrProps As String, SortType As String,_ 
SortField As String, Top as long, Every as long)
Parameters
Source
The data source name (It can be only "CIM").
ClassName
The name of the Dynamic Model class being defined.
RealClassName
The full pathname of the CIM class to be associated with the Dynamic Model class being defined.
WhereClause
A where clause used to filter the instances.
NumProps
Comma-separated values with the names of class NUMERIC attributes.
StrProps
Comma-separated values with the names of class STRING attributes.
SortType
Used to sort the collected instances. It can be set to Ascending, Descending, or None.
SortField
A NUMERIC field used for sorting the collected instances.
Top
Used only when the instances are sorted, to specify the maximum number of instances to collect. Set to 0 to get all the instances.
Every
Specifies the number of cycle times that have to elapse between two successive data collections. The default is 1.
Description
Adds a new class to the resource model dynamic model.
Remarks
The ClassName must be previously defined in the Dynamic Model window.
Error codes

S_OK
TMWSERVICE_E_CLASS_NAME_NOT_VALID
TMWSERVICE_E_SOURCE_NOT_SUPPORTED

Method DefineCimClassAsync

Syntax
Object.DefineClassAsync(ClassName As String,_ 
RealClassName As String,_ 
EvType As String, NumProps As String, StrProps As String)
Parameters
ClassName
The name of the Dynamic Model class being defined.
RealClassName
The full pathname of the CIM class to be associated with the Dynamic Model class being defined.
EvType
Used to specify the kind of asynchronous collection. It can be set to InstanceCreation, InstanceModification, or InstanceDeletion.
NumProps
Comma-separated values with the names of class NUMERIC attributes.
StrProps
Comma-separated values with the names of class STRING attributes.
Description
Adds a new class to the resource model dynamic model.
Error codes

S_OK
TMWSERVICE_E_CLASS_NAME_NOT_VALID

Method RemoveClass

Syntax
Object.RemoveClass(ClassName As String)
Parameters
ClassName
The name of the Dynamic Model class.
Description
Removes the class named ClassName from the resource model dynamic model.
Error codes

S_OK
TMWSERVICE_E_PROPERTY_NOT_FOUND

Method CollectData

Syntax
Object.CollectData()
Description
Collects data for all the classes belonging to the resource model dynamic model.
Remarks
This method is called from IBM Tivoli Monitoring engine before the VisitTree function is called. By default, it is called every cycle time, unless otherwise specified in the Every option of the Dynamic Model window. Do not call this method. If you invoke this method, a new collection of the data defined in the resource model starts. So if, for example, you are in a loop, you risk changing data during the analysis.
Error codes

S_OK
TMWSERVICE_E_COLLECTOR_UNABLE_TO_USE_PROV
TMWSERVICE_E_COLLECTOR_CRITICAL_ERROR
TMWSERVICE_E_COLLECTOR_PROV_NOT_READY

Method CollectClassData

Syntax
Object.CollectClassData(ClassName As String)
Parameters
ClassName
The name of the Dynamic Model class.
Description
Collects data only for the specified Dynamic Model class.
Remarks
Do not call this method if you are analyzing the defined class. Invoking this method, a new collection of the data defined in the resource model starts. So if, for example, you are in a loop, you risk changing data during the analysis. The ClassName must be previously defined through in the Dynamic model window.
Error codes

S_OK
TMWSERVICE_E_COLLECTOR_UNABLE_TO_USE_PROV
TMWSERVICE_E_COLLECTOR_CRITICAL_ERROR
TMWSERVICE_E_COLLECTOR_PROV_NOT_READY

Method DefineDMNumProbe

Syntax
Object.DefineDMNumProbe(key As String, numOfArgs As Long)
Parameters
key
A key that uniquely identifies the monitoring source, always in the form CollectionName.MonitorName.
numOfArgs
The number of arguments required by the monitor.
Description
This method adds to the dynamic model a Tivoli Distributed Monitoring (Classic Edition) monitoring source that returns a numeric value.
Error code
S_OK

Method DefineDMStrProbe

Syntax
Object.DefineDMStrProbe(key As String, numOfArgs As Long)
Parameters
key
A key that uniquely identifies the monitoring source, always in the form CollectionName.MonitorName.
numOfArgs
The number of arguments required by the monitor.
Description
This method adds to the dynamic model a Tivoli Distributed Monitoring (Classic Edition) monitoring source that returns a string value.
Error code
S_OK

Example

Table 21. Advanced Object Method dynamic model examples
Visual Basic example:

Svc.DefineClass "CIM", "Win32_Process", "root\cimv2:Win32_Process",
"WHERE Name = ""calc.exe""", "", "Handle,Name", "None", "", 0, 1
Svc.DefineClassAsync "Win32_Process", "root\cimv2:Win32_Process",
"InstanceDeletion", "", "Handle,Name"

Svc.DefineDMStrProbe ("w2k_Process.NtServices", 1)
Svc.DefineDMNumProbe ("w2k_Process.HandleCnt", 1)

JavaScript example:

Svc.DefineClass ("CIM", "Win32_Process", "root\\cimv2:Win32_Process",
"WHERE Name = \"calc.exe\"", "", "Handle,Name", "None", "", 0, 1);
Svc.DefineClassAsync ("Win32_Process", "root\\cimv2:Win32_Process",
"InstanceDeletion", "", "Handle,Name");

Svc.DefineDMStrProbe ("w2k_Process.NtServices", 1);
Svc.DefineDMNumProbe ("w2k_Process.HandleCnt", 1);


[ Top of Page | Previous Page | Next Page | Contents | Index ]