
156 D
OMINION
SX
I
NSTALLATION AND
O
PERATIONS
M
ANUAL
Basic CPU Utilization Monitoring Example
#Description: This TCL script checks the CPU utilization for each port connected
#
to a HP-UX server. It alerts the subscribed user that the threshold
#
limit has reached through e-mail notification. This TCL script uses
#
vmstat to find out the CPU usage of the user process and checks with
#
given threshold limit. During the process user can input the threshold
#
limit or the interval through the following commands:
#
THR <threshold> - Input of threshold
#
INTR <interval> - Interval at which the TCL script has to do checking.
#
To quit out of the script type QUIT and hit enter
#Default threshold is 2 %
set thr 2
#Default interval is 10 seconds
set intr 10
#change this mail id to your own
set mailid "mailto://[email protected]"
#initalize events
proc initEvents { } {
global
mailid
#add subscriptions to events.
ampaddsubscription event.alarm.cpu $mailid
#save
subscription
ampsave
}
#delete events. Called during QUIT
proc delEvents { } {
global
mailid
#delete subscriptions to events
amprmsubscription
event.alarm.cpu
$mailid
#save
configuration
ampsave
}
#Retrive cpu utilization for user process,
#check if it has reached the threshold and trigger an event
proc cpuUtil { port } {
global
thr
set
us
0
set sy 0
set
id
0
#lock the console
amplock
$port
Summary of Contents for SX32
Page 2: ...This page intentionally left blank ...
Page 4: ...This page intentionally left blank ...
Page 78: ...68 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 90: ...80 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 94: ...84 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 102: ...92 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 106: ...96 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 108: ...98 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 122: ...112 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 134: ...124 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 174: ...164 DOMINION SX INSTALLATION AND OPERATIONS MANUAL ...
Page 177: ...APPENDIX J TECHNICAL FAQS 167 ...
Page 178: ...168 DOMINION SX INSTALLATION AND OPERATIONS MANUAL 255 60 2000 ...