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 GetNumOfInst

Syntax
Object.GetNumOfInst(ClassName As String) As Long
Parameters
ClassName
The name of the Dynamic Model class.
Description
Returns the number of the collected instances of the Dynamic Model class named ClassName in the current monitoring cycle.
Remarks
The ClassName must be previously defined through in the Dynamic model window.
Error codes

S_OK
TMWSERVICE_E_CLASS_NOT_FOUND

Method GetNumProperty

Syntax
Object.GetNumProperty(ClassName As String, 
idx As Long, PropName As String) As Double
Parameters
ClassName
The name of the Dynamic Model class.
idx
The instance index.
PropName
The name of a NUMERIC property.
Description
Returns the value of the property named PropName of the instance number idx of the Dynamic Model class named ClassName.
Remarks
idx counter goes from 0 to NumOfInst -1. The ClassName must be previously defined in the Dynamic model window.
Error codes

S_OK
TMWSERVICE_E_PROPERTY_NOT_FOUND

Method GetStrProperty

Syntax
Object.GetStrProperty(ClassName As String, idx As Long, PropName 
As String) As String
Parameters
ClassName
The name of the Dynamic Model class.
idx
The instance index.
PropName
The name of a STRING property.
Description
Returns the value of the property named PropName of the instance number idx of the Dynamic Model class named ClassName.
Remarks
idx counter goes from 0 to NumOfInst -1. The ClassName must be previously defined in the Dynamic Model window.
Error codes

S_OK
TMWSERVICE_E_PROPERTY_NOT_FOUND

Method AssociateParameterToClass

Syntax
Object.AssociateParameterToClass 
(ParameterName As String, ClassName As String)
Parameters
ParameterName
The name of the parameter to use as the argument for the provider operations on the specified class.
ClassName
The name of the Dynamic Model class whose provider operations are to be executed using the specified parameter as an argument.
Description
Defines an existing parameter as the argument for the provider operations on the Dynamic Model class named ClassName.
Remarks
This method is for UNIX operating systems, only. The ClassName must be previously defined in the Dynamic model window.

Method AssociateParameterToClassProperty

Syntax
Object.AssociateParameterToClassProperty 
(ParameterName As String, ClassName As String, Property As String)
ParameterName
The name of the parameter to use as the argument for the provider operations on the specified class property.
ClassName
The name of the Dynamic Model class to which the property belongs.
PropertyName
The name of the property whose provider operations are to be executed using the specified parameter as an argument.
Description
Defines an existing parameter as the argument for the provider operations on the Dynamic Model class property named ClassProperty.
Remarks
This method is for UNIX operating systems, only. The ClassName must be previously defined in the Dynamic model window.

Method CallDMNumProbe

Syntax
Object.CallDMNumProbe(ProbeKey As String, Arguments As String) As Double
Parameters
Probekey
A key that uniquely identifies the monitoring source and is always in the form CollectionName.MonitorName.
Arguments
A string that contains the monitor arguments separated by blanks.
Returns
The numeric value resulting from the monitor call.
Description
This method runs the monitoring source identified by ProbeKey and returns its output.
Remarks
The monitoring source activation must return within 60 seconds, otherwise an error generates.
Error codes

TMWSERVICE_E_PROBE_WRONG_ARGS_NUM
TMWSERVICE_E_PROBE_NOT_LOAD
TMWSERVICE_E_PROBE_NOT_FOUND
TMWSERVICE_E_NO_INTERP_SUPPORT
TMWSERVICE_E_NO_DATA
TMWSERVICE_E_IMPLIED_ERROR
TMWSERVICE_E_ERRORVALUE_SCRIPT_ERROR
S_OK

Method CallDMStrProbe

Syntax
Object.CallDMStrProbe(ProbeKey As String, Arguments As String) As String
Parameters
Probekey
A key that uniquely identifies the monitoring source and is always in the form CollectionName.MonitorName.
Arguments
A string that contains the monitor arguments separated by blanks.
Returns
The string value resulting from the monitor call.
Description
This method runs the monitoring source identified by ProbeKey and returns its output.
Remarks
The monitoring source activation must return within 60 seconds, otherwise an error generates.
Error codes

TMWSERVICE_E_PROBE_WRONG_ARGS_NUM
TMWSERVICE_E_PROBE_NOT_LOAD
TMWSERVICE_E_PROBE_NOT_FOUND
TMWSERVICE_E_NO_INTERP_SUPPORT
TMWSERVICE_E_NO_DATA
TMWSERVICE_E_IMPLIED_ERROR
TMWSERVICE_E_ERRORVALUE_SCRIPT_ERROR S_OK

Example

Table 14. Basic Object Method dynamic model examples
Visual Basic example:

Dim id, numOfInstances As Integer
Dim process As String

numOfInstances = Svc.GetNumOfInst("TMW_Process")
For idx = 0 To numOfInstances - 1
'retrieve the numeric property, ID, for the given instance of TMW_Process
id = Svc.GetNumProperty("TMW_Process", idx, "ID")

'retrieve the string property, Process, for the given instance of TMW_Process
process = Svc.GetStrProperty("TMW_Process", idx, "Process")
Next

JavaScript example:

var id, numOfInstances;
var process;

numOfInstances = Svc.GetNumOfInst("TMW_Process");
for(idx = 0; idx < numOfInstances; idx++){
//retrieve the numeric property, ID, for the given instance of TMW_Process
id = Svc.GetNumProperty("TMW_Process", idx, "ID");

//retrieve the string property, Process, for the given instance of TMW_Process

id = Svc.GetStrProperty("TMW_Process", idx, "Process");
}


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