For agents registered as V40 and earlier, the ArgList attribute is a predefined static attribute that specifies the list of attributes whose values are passed to the entry points.
The parameter attr_val is an array of character pointers that contains the ArgList
attribute values. The last element of the array is a NULL pointer. Attribute values in attr_val are listed in the same order as attributes in ArgList
.
The values of scalar attributes (integer and string) are each contained in a single element of attr_val
. The values of non-scalar attributes (vector, keylist, and association) are contained in one or more elements of attr_val
.
The open, close
, online
, offline
, monitor
, action
, info
, and clean
scripts receive the resource name and values of the ArgList
attributes. The ArgList attribute behavior varies depending on whether the agent uses the
For agents registered as V40 and earlier:
ArgList
attributes (integer and string) are each contained in a single command-line argument.
ArgList
attributes (vector, keylist, and association) are contained in one or more command-line arguments.
If a vector or association attribute contains N components, it is represented by N+1 command-line arguments. The first command-line argument is N, and the remaining N arguments correspond to the N components. (See "ArgList" on page 173.)
See the chapter describing the configuration language in the User's Guide for attribute definitions.
For example, if Type "Foo" is defined in the file types.cf
as:
static str ArgList[] = { IntAttr, StringAttr,
And if a resource "Bar" is defined in the file main.cf
as:
VectorAttr = { "vol1", "vol2", "vol3" }
AssocAttr = { "disk1" = "1024", "disk2" = "512" }
Then, for V50, the parameter attr_val is:
attr_val[1] = "1" // Number of components in
attr_val[2] = "100" // Value of IntAttr
attr_val[4] = "1" // Number of components in
attr_val[5] = "Oracle" // Value of StringAttr
attr_val[7] = "3" // Number of components in
attr_val[12] = "4" // Number of components in
attr_val[17] = NULL // Last element
Or, for V40 and earlier, the parameter attr_val is:
attr_val[0] ===> "100" // Value of IntAttr, the first
attr_val[1] ===> "Oracle" // Value of StringAttr.
attr_val[2] ===> "3" // Number of components in
attr_val[6] ===> "4" // Number of components in
attr_val[11]===> NULL // Last element.