有四個延伸指令可用於管理物件屬性及屬性值。
物件屬性指令可以使用以下參數。如需有關 a、m、 f 和 columns 參數的詳細資訊,請參閱預先定義的參數和旗標。
mgtObj 參數的值是其屬性已被設定或擷取的受管理物件的名稱。
property 參數的值是其屬性和值已被設定或擷取的屬性的名稱。
propInst 參數的值是其屬性和值已被指定或擷取的屬性實例的名稱。
rowValues 參數的值是以逗號分隔的名稱 - 值組清單。name 是列中欄位的名稱。value 是該欄位中的值。
attributes 參數的值是以逗號分隔的屬性名稱清單,這些屬性名稱屬於其屬性和值已被設定或擷取的屬性。當與 setAttributes 指令配合使用時,attributes 參數中的每個屬性名稱在 values 參數中均必須具有對應的值。
values 參數的值是以逗號分隔並對應於 attributes 參數中指定屬性的值清單。當與 setAttributes 指令配合使用時,每個指定的屬性均必須有值。
您可以使用以下指令設定與擷取物件屬性及屬性值:
addRow 指令可向表格中新增列。addRow 指令具有以下參數: a、m、mgtObj、property、propInst 和 rowValues。
delRow 指令可從表格中刪除列。delRow 指令具有以下參數: a、m、mgtObj、property、propInst 和 rowValues。
getAttributes 指令可從代理程式或代理程式群組中擷取指定屬性。getAttributes 指令具有以下參數: a、f、m、columns、 mgtObj、property、propInst 和 attributes。
setAttributes 指令可為代理程式或代理程式群組中的指定屬性指定值。setAttributes 指令具有以下參數: a、m、mgtObj、property、propInst、attributes 和 values。
對於在 attributes 參數中指定的每個屬性,values 參數中必須有對應的值。
以下指令可擷取主機 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 attributes=alarmlimits.error-gt values=2 |
以下指令可從 mgtObj 中指定的受管理物件中刪除在 rowValues 中指定的列:
> delRow a=haiku:1161 \ m=filemon mgtObj=filemonstats/filemonTable/filemonEntry \ rowValues="name=test,desc=this,filename=/etc/passwd" |