
A
PPENDIX
H:
TCL
P
ROGRAMMING
G
UIDE
157
#clear any previous data in the read buffer
ampclear
$port
#write to the console
ampwrite "vmstat -n\n" $port
#ignore the first 8 lines to read the cpu usage params.
for {set i 0 } {$i < 9} {incr i +1} {
set cpu [ampread 1 "\n" $port]
}
#unlock the console
ampunlock
$port
#set the user's cpu usage
scan $cpu "%d %d %d" us sy id
#Trigger event if user process utilization has gone beyond threshold
if { $us > $thr } {
amptriggerevent event.alarm.cpu "User Process CPU utilization goes beyond threshold
$thr on port$port"
}
}
#listen to command inputs from user - QUIT/THR/INTR
proc ListenCmds { } {
global thr incr
set cmd [amplisten]
if { [string compare $cmd "QUIT"] == 0 } {
puts
"Quitting"
ampresponse
return 1
} elseif [string match THR* $cmd] {
scan $cmd "%s %d" c thr
puts
"Threshold
is
$thr"
ampresponse
} elseif [string match INTR* $cmd] {
scan $cmd "%s %d" c intr
puts
"Interval
now
is
$intr"
ampresponse
}
ampresponse
}
set ports 1
set noOfPorts 2
Содержание SX32
Страница 2: ...This page intentionally left blank ...
Страница 4: ...This page intentionally left blank ...
Страница 78: ...68 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 90: ...80 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 94: ...84 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 102: ...92 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 106: ...96 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 108: ...98 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 122: ...112 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 134: ...124 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 174: ...164 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Страница 177: ...APPENDIX J TECHNICAL FAQS 167 ...
Страница 178: ...168 DOMINION SX INSTALLATION AND OPERATIONS MANUAL 255 60 2000 ...