取消
顯示結果 
搜尋替代 
您的意思是: 

resls 的運用問題

resls 的運用問題

在mc/service guard裡面

只要填入

ex:

RESOURCE_NAME /system/filesystem/availMb/var

這樣就可以拿/var 的 剩餘空間來做判斷的依據

請問我有辦法透過command 的方式直接get 到他的值嗎

resource 有下列幾項

我想直接透過resls去撈出裡面的值

有辦法做到嗎?

Resource Class

/system

/StorageAreaNetwork

/adapters

/connectivity

/cluster

/storage

/net
5 回覆

resls 的運用問題

如果只是要做到monitor filesystem usage, 透過簡單的shell script就可以囉.



範例如下. 你可將fsmon.ksh定在cron table中.



----------------------------------------------

- fsmon.conf - "mountpoint" "threshold"

----------------------------------------------

/ 60

/var 60

/usr 60

/tmp 60

/opt 70

/erp01 80

/erpdb01 80

/ora_arch 70

/home 80

/var/adm/crash 0

/stand 60



----------------------------------------------

- fsmon.ksh

----------------------------------------------

#!/bin/ksh



bdf_snap=/tmp/bdf.$$



bdf|grep -v Filesystem|awk '{print $6,$5}'|awk -F% '{print $1,$2}' > ${bdf_snap}



cat fsmon.conf2|while read fspath fstresh

do

integer fscurr=`cat ${bdf_snap}|awk '($1=="'${fspath}'"){print $2}'`

if ]; then

echo ${fspath} over treshold, current usage is ${fscurr}

fi

done



rm -f ${bdf_snap}

resls 的運用問題

修正一下, 打錯一個字



----------------------------------------------

- fsmon.ksh

----------------------------------------------

#!/bin/ksh



bdf_snap=/tmp/bdf.$$



bdf|grep -v Filesystem|awk '{print $6,$5}'|awk -F% '{print $1,$2}' > ${bdf_snap}



cat fsmon.conf|while read fspath fstresh

do

integer fscurr=`cat ${bdf_snap}|awk '($1=="'${fspath}'"){print $2}'`

if ]; then

echo ${fspath} over treshold, current usage is ${fscurr}

fi

done



rm -f ${bdf_snap}

resls 的運用問題

filesystem usage也是我要的

但是我主要的用意是去抓其他的值

這樣我就可以透過command get 到他的值了

所以就不用寫很多scripts 來達到相同的目的

resls 的運用問題

for example ? tempature ?

resls 的運用問題

例如我想知道lan900 up or down

但是很像沒辦法直接用resls get 到他的值

$ resls /net/interfaces/lan/status/lan900

Contacting Registrar on haggai



NAME: /net/interfaces/lan/status/lan900

DESCRIPTION: LAN Interface Status



The current operational state of the interface. Possible values are:



UP The LAN interface is sending and receiving packets.

DOWN The LAN interface is not passing operational packets.



TYPE: /net/interfaces/lan/status/lan900 is a Resource Instance

whose values are enumerated values.



There are 2 valid states reported for /net/interfaces/lan/status/lan900:



State Value State Name

----------- ----------

1 UP

2 DOWN



There are no active monitor requests reported for this resource.