A
PPENDIX
H:
TCL
P
ROGRAMMING
G
UIDE
151
#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
Summary of Contents for DOMINION SX -
Page 2: ......
Page 4: ...This page intentionally left blank...
Page 20: ...10 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 78: ...68 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 80: ...70 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 88: ...78 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 96: ...86 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 98: ...88 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 100: ...90 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 102: ...92 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 116: ...106 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 128: ...118 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 168: ...158 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 171: ...APPENDIX J TECHNICAL FAQS 161...
Page 172: ...162 DOMINION SX INSTALLATION AND OPERATIONS MANUAL 255 60 2000...