I'm testing out the following proc. I put it in my tcl directory and it checks for
long running scripts and puts an error about them in the error log. Then
aolserver-errors.pl emails me the errors.
Does anyone know of a timeout setting in aolserver so my script can't just
run forever? Any script of mine running longer than 90 seconds is bad and
should be killed.
proc vt_monitor_long_running_scripts {} {
# check for long running scripts and add an error to the log for each
set connections [ns_server active]
foreach connection $connections {
set conn [lindex $connection 0]
set client_ip [lindex $connection 1]
set state [lindex $connection 2]
set method [lindex $connection 3]
set url [lindex $connection 4]
set n_seconds [lindex $connection 5]
set bytes [lindex $connection 6]
if {$n_seconds > 90} {
ns_log error "Conn #: $conn Client IP: $client_ip State: $state
Method: $method URL: $url n seconds: ${n_seconds} bytes: $bytes "
}
}
}
ad_schedule_proc 60 vt_monitor_long_running_scripts