Sun Management Center 3.6 用户指南

对象属性扩展命令

有四个用于管理对象属性和属性值的扩展命令。

对象属性命令的参数

以下参数可以由对象属性命令使用。有关 am 参数的详细信息,请参阅预定义的参数和标记

mgtObj

mgtObj 参数的值是被管理对象的名称,该对象的属性(attribute 和 property)正在被设置或被检索。

property

property 参数的值是属性 (property) 的名称,该属性的子属性 (attribute) 正在被设置或被检索。

propInst

propInst 参数的值是属性 (property) 实例的名称,该属性的子属性 (attribute) 和值正在被设置或被检索。

rowValues

rowValues 参数的值是以逗号分隔的“名称-值”参数对列表。name 是行中列的名称。value 是该列中的值。

attribute

attribute 参数的值是以逗号分隔的子属性 (attribute) 名称列表,其所属属性 (property) 的子属性和值正在被设置或检索。在与 setAttributes 命令一起使用时,attribute 参数中的每个属性名称都必须在 value 参数中有一个相应的值。

value

value 参数的值是由逗号分隔的值的列表,这些值与在 attribute 参数中指定的属性相对应。与 setAttributes 命令一起使用时,每个指定的属性必须有一个值。

对象属性命令

您可以使用以下命令设置和检索对象属性和属性值:

addRow

说明

addRow 命令可以将具有指定值的行添加到表格内。

语法

addRow a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject [property=property] [propInst=propertyInstance] rowValues=name=value[,name=value]

参数

ammgtObj propertypropInstrowValues

delRow

说明

delRow 命令可以将具有指定值的行从表中删除。

语法

delRow a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject [property=property] [propInst=propertyInstance] rowValues=name=value[,name=value]

参数

ammgtObj propertypropInstrowValues

getAttributes

说明

getAttributes 命令可以检索属性信息,或者从一个或多个代理检索指定的属性。

语法

getAttributes a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject property=property [propInst=propertyInstance] [attribute=attribute[,attribute]*]

参数

ammgtObj propertypropInstattribute

setAttributes

说明

setAttributes 命令可以设置单个属性,也可以设置一个或多个代理中的多个属性。

语法

setAttributes a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject property=property [propInst=propertyInstance] [attribute=attribute[,attribute]*] value=value[,value]*

参数

ammgtObj propertypropInstattributevalue

对于在 attribute 参数中指定的每个属性,value 参数中必须有一个相应的值。

对象属性命令的示例

以下命令检索主机 haiku 端口 1161 处 agent-stats 模块中的被管理对象 totalstatssize 属性 (property) 的所有子属性 (attribute):


> getAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \
property=size

以下命令将上例指定的 size 属性 (property) 中的 alarmlimits.error-gt 子属性 (attribute) 设置为 2


> setAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \
property=size attribute=alarmlimits.error-gt value=2

以下命令从被管理对象中(由 mgtObj 参数指定)删除由 rowValues 参数指定的行:


> delRow a=haiku:1161 \
m=filemon mgtObj=filemonstats/filemonTable/filemonEntry \
rowValues="name=test,desc=this,filename=/etc/passwd"