有四个用于管理对象属性和属性值的扩展命令。
以下参数可以由对象属性命令使用。有关 a 和 m 参数的详细信息,请参阅预定义的参数和标记。
property 参数的值是属性 (property) 的名称,该属性的子属性 (attribute) 正在被设置或被检索。
propInst 参数的值是属性 (property) 实例的名称,该属性的子属性 (attribute) 和值正在被设置或被检索。
attribute 参数的值是以逗号分隔的子属性 (attribute) 名称列表,其所属属性 (property) 的子属性和值正在被设置或检索。在与 setAttributes 命令一起使用时,attribute 参数中的每个属性名称都必须在 value 参数中有一个相应的值。
value 参数的值是由逗号分隔的值的列表,这些值与在 attribute 参数中指定的属性相对应。与 setAttributes 命令一起使用时,每个指定的属性必须有一个值。
说明
语法
addRow a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject [property=property] [propInst=propertyInstance] rowValues=name=value[,name=value]
参数
a、m、mgtObj、 property、propInst 和 rowValues。
说明
语法
delRow a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject [property=property] [propInst=propertyInstance] rowValues=name=value[,name=value]
参数
a、m、mgtObj、 property、propInst 和 rowValues。
说明
getAttributes 命令可以检索属性信息,或者从一个或多个代理检索指定的属性。
语法
getAttributes a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject property=property [propInst=propertyInstance] [attribute=attribute[,attribute]*]
参数
a、m、mgtObj、 property、propInst 和 attribute。
说明
setAttributes 命令可以设置单个属性,也可以设置一个或多个代理中的多个属性。
语法
setAttributes a=host[:port][,host[:port]]* m=module[+instance] mgtObj=managedObject property=property [propInst=propertyInstance] [attribute=attribute[,attribute]*] value=value[,value]*
参数
a、m、mgtObj、 property、propInst、attribute 和 value。
对于在 attribute 参数中指定的每个属性,value 参数中必须有一个相应的值。
以下命令检索主机 haiku 端口 1161 处 agent-stats 模块中的被管理对象 totalstats 中 size 属性 (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" |