
A
PPENDIX
I: TCL P
ROGRAMMING
G
UIDE
125
Generating a User Event
TCL scripts are a powerful tool for performing true device management, in the form of customer-defined monitoring
and notification of events. A sample script is shown below:
#This script performs the monitoring of HTTP servers.
proc pstat {procname port_num} {
set psef [concat "ps -ef | grep " $procname | grep -v "grep" | wc -l]
ampexec "stty -echo\r" 5 "#" $port_num
set output [ampexec "$psef\r" 10 "#" $port_num]
ampexec "stty echo\r" 5 "#" $port_num
return [lindex $output 0]
}
# add subscription to an event here.
ampaddsubscription event.user.httpProcess “[email protected]”
# Run through 4 different servers to find out if HTTP service is running
# on each one of them and trigger an event appropriately.
for {set port_num 0} {$port_num < 4} {incr po1} {
ampclear $port_num
amplock $port_num
set output [pstat httpd $port_num]
ampunlock $port_num
if {$output > 0} {
puts "HTTP_SERVER_OK $port_num"
amptriggerevent event.user.httpProcess “HTTP service is up and running on $port_num”
} else {
puts " HTTP_SERVER_ERROR $port_num"
amptriggerevent event.user.httpProcess “HTTP service down on $port_num”
}
}
In the Notification tab of the unit, the user can subscribe to either of the following:
event.user or event.user.httpProcess
to get this message: “HTTP service is up and running on 1”. To subscribe to
user-defined events (defined in the TCL script), the event name must be specified.
Note:
This Event Name must match
EXACTLY
with the event name the user generated using the
TCL script.
event.user
will send out an notification whenever this event is triggered.
event.user.httpProcess
will be sent out only when this specific event occurs. The entry must be
entered in the notification tab exactly as it appears in the script.
Summary of Contents for Dominion SX16
Page 1: ...Installation and Operations Manual SX16 SX32...
Page 2: ...This page intentionally left blank...
Page 4: ...This page intentionally left blank...
Page 6: ...This page intentionally left blank...
Page 10: ...iv TABLE OF CONTENTS...
Page 14: ...viii TABLE OF FIGURES...
Page 24: ...10 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 30: ...16 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 82: ...68 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 84: ...70 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 86: ...72 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 88: ...74 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 102: ...88 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 114: ...100 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 120: ...106 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 132: ...118 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 158: ...144 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...
Page 161: ...APPENDIX K TECHNICAL FAQS 147 DSX 0A E 255 60 2000...
Page 162: ...148 DOMINION SX INSTALLATION AND OPERATIONS MANUAL...