有四個延伸指令可用來管理物件屬性及屬性值。
下列參數可被物件屬性指令所用:如需關於 a 和 m 參數的詳細資訊,請參閱預先定義的參數和旗標。
attribute 參數的值是以逗號分隔之已設定或擷取其屬性和值之特性的屬性名稱清單。當與 setAttributes 指令配合使用時,attribute 參數中的每個屬性名稱在 value 參數中均必須具有對應的值。
value 參數的值是以逗號分隔並對應於 attributes 參數中指定屬性的值清單。當與 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 特性的全部屬性:
> getAttributes a=haiku:1161 m=agent-stats mgtObj=totalstats \ property=size |
以下指令可將先前範例中指定的 size 特性中的屬性 alarmlimits.error-gt 的值設為 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" |