Etc.

전체 CPU 사용률 모니터링을 위한 쉘 스크립트

커널64 2012. 7. 30. 12:49
SCOM System Center SCX Cross Platform UNIX Linux Shell Script

# Alert Description
# $Data/Context///*[local-name()="StdOut"]$

Threshold=80

processorutil=`/opt/microsoft/scx/bin/tools/scxcimcli xq "select * from SCX_ProcessorStatisticalInformation Where Name=\"_Total\"" -n root/scx | grep PercentProcessorTime | sed 's/\;$//' | awk {'print $3'}`

if [ $processorutil -gt $Threshold ]
then
     echo The threshold for the Processor\% Processor Time\_Total performance counter has been exceeded. The values that exceeded the threshold are: $processorutil. State is BAD.
else
     echo The processor utilization status is normal. State is GOOD.
fi