Index: openacs-4/packages/monitoring/monitoring.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/monitoring.info,v diff -u -r1.2 -r1.3 --- openacs-4/packages/monitoring/monitoring.info 9 Mar 2002 02:00:02 -0000 1.2 +++ openacs-4/packages/monitoring/monitoring.info 19 Aug 2002 23:10:28 -0000 1.3 @@ -1,19 +1,22 @@ - + Monitoring Monitoring + f t - + oracle + postgresql - Joseph Bank - Monitoring apps from ACS 3.4.x - 2001-02-01 - ArsDigita Corporation + Joseph Bank + Vinod Kurup + Monitoring apps ported from ACS 3.4.x + 2002-08-19 + OpenACS The monitoring apps from ACS 3.4.x /admin/monitoring directory. Includes Cassandracle, Watchdog, etc. @@ -23,9 +26,15 @@ + + + + + + @@ -59,24 +68,33 @@ + + + + + + + + - - - - - - - + + + + + + + + Index: openacs-4/packages/monitoring/sql/oracle/monitoring-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/sql/oracle/monitoring-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/sql/oracle/monitoring-drop.sql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,19 @@ +-- +-- /packages/monitoring/sql/oracle/monitoring-drop.sql +-- +-- Monitoring drop script +-- +-- @author Vinod Kurup (vinod@kurup.com) +-- @creation-date 2002-08-17 +-- @cvs-id $Id: monitoring-drop.sql,v 1.1 2002/08/19 23:10:28 vinodk Exp $ +-- + +drop sequence ad_monitoring_tab_est_seq start; +drop table ad_monitoring_tables_estimated; + +drop sequence ad_monitoring_top_proc_proc_id; +drop table ad_monitoring_top_proc; + +drop sequence ad_monitoring_top_top_id; +drop table ad_monitoring_top; + Index: openacs-4/packages/monitoring/sql/postgresql/monitoring-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/sql/postgresql/monitoring-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/sql/postgresql/monitoring-create.sql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,114 @@ +-- +-- /packages/monitoring/sql/postgresql/monitoring-drop.sql +-- +-- Description: Definition for general system monitoring +-- +-- @author Vinod Kurup (vinod@kurup.com) PG Port only +-- @creation-date 2002-08-17 +-- @cvs-id $Id: monitoring-create.sql,v 1.1 2002/08/19 23:10:28 vinodk Exp $ +-- +-- Just doing a straight port right now. I'm not sure how much of this +-- stuff is Oracle-specific and thus useless for PG. + + +-- simple table to gather stats from top +-- where top's output looks like this (from dev0103-001:/usr/local/bin/top): + +-- load averages: 0.21, 0.18, 0.23 21:52:56 +-- 322 processes: 316 sleeping, 3 zombie, 1 stopped, 2 on cpu +-- CPU states: 3.7% idle, 9.2% user, 7.1% kernel, 80.0% iowait, 0.0% swap +-- Memory: 1152M real, 17M free, 593M swap in use, 1432M swap free +-- +-- PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND +-- 17312 oracle 1 33 0 222M 189M sleep 17:54 0.95% oracle +-- 9834 root 1 33 0 2136K 1528K sleep 0:00 0.43% sshd1 + + +create sequence ad_monitoring_top_top_id start 1; + +create table ad_monitoring_top ( + top_id integer + constraint ad_mntr_top_id_pk primary key, + timestamp timestamp default current_timestamp, + -- denormalization: an indexable column for fast time comparisons. + timehour numeric(2), + -- the three load averages taken from uptime/top + load_avg_1 numeric, + load_avg_5 numeric, + load_avg_15 numeric, + -- basic stats on current memory usage + memory_real numeric, + memory_free numeric, + memory_swap_free numeric, + memory_swap_in_use numeric, + -- basic stats on the number of running procedures + procs_total integer, + procs_sleeping integer, + procs_zombie integer, + procs_stopped integer, + procs_on_cpu integer, + -- basic stats on cpu usage + cpu_idle numeric, + cpu_user numeric, + cpu_kernel numeric, + cpu_iowait numeric, + cpu_swap numeric +); + + +-- this table stores information about each of the top 10 or so +-- processes running. Every time we take a snapshot, we record +-- this basic information to help track down stray or greedy +-- processes +create sequence ad_monitoring_top_proc_proc_id start 1; +create table ad_monitoring_top_proc ( + proc_id integer + constraint ad_mntr_top_proc_pk primary key, + top_id integer not null + constraint ad_mntr_top_proc_top_id_fk + references ad_monitoring_top, + pid integer not null, -- the process id + username varchar(10) not null, -- user running this command + threads integer, -- the # of threads this proc is running + priority integer, + nice integer, -- the value of nice for this process + proc_size varchar(10), + resident_memory varchar(10), + state varchar(10), + cpu_total_time varchar(10), -- total cpu time used to date + cpu_pct varchar(10), -- percentage of cpu currently used + -- the command this process is running + command varchar(30) not null +); + +-- the following table is lifted from the Oracle version, but is likely +-- not useful here. 2002-08-19 vinodk + +-- Begin Estimation module datamodel. +-- the following table lists tables which are to be estimated. +-- A scheduled proc runs +-- analyze table estimate statistics sample +-- where table-name is pulled from the table as is percent_estimating + +create table ad_monitoring_tables_estimated ( + table_entry_id integer + constraint ad_mntr_table_estim_pk primary key, + -- This is a table name, but we don't want it to + -- reference user_tables since then deleting a table + -- would be problematic, since this would reference it + -- Instead, in the proc we use to run this (a scheduled + -- proc, we check to make sure the table exists. + table_name varchar(40) + constraint amte_table_name_nn not null, + -- The percent of the table we estimate, defaults to 20% + percent_estimating integer default 20, + last_percent_estimated integer, + --Do we actually want to run this? + enabled_p boolean, + last_estimated timestamp +); + +--Sequence for above table +create sequence ad_monitoring_tab_est_seq start 1000; + +-- EOF Index: openacs-4/packages/monitoring/sql/postgresql/monitoring-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/sql/postgresql/monitoring-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/sql/postgresql/monitoring-drop.sql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,19 @@ +-- +-- /packages/monitoring/sql/postgresql/monitoring-drop.sql +-- +-- Monitoring drop script +-- +-- @author Vinod Kurup (vinod@kurup.com) +-- @creation-date 2002-08-17 +-- @cvs-id $Id: monitoring-drop.sql,v 1.1 2002/08/19 23:10:28 vinodk Exp $ +-- + +drop sequence ad_monitoring_tab_est_seq; +drop table ad_monitoring_tables_estimated; + +drop sequence ad_monitoring_top_proc_proc_id; +drop table ad_monitoring_top_proc; + +drop sequence ad_monitoring_top_top_id; +drop table ad_monitoring_top; + Index: openacs-4/packages/monitoring/tcl/monitoring-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/monitoring-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/tcl/monitoring-init.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/tcl/monitoring-init.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -1,9 +1,9 @@ # /packages/monitoring/tcl/monitoring-init.tcl ad_library { - Initialization code - @author jbank@arsdigita.com [jbank@arsdigita.com] - @creation-date Tue Jan 30 16:33:58 2001 - @cvs-id + Initialization code + @author jbank@arsdigita.com [jbank@arsdigita.com] + @creation-date Tue Jan 30 16:33:58 2001 + @cvs-id $Id$ } # TopFrequency determines how often this proc is run, in minutes. @@ -13,9 +13,11 @@ ns_log Notice "top_frequency is $top_frequency" if { $top_frequency > 0 } { - set top_frequency_in_seconds [expr 60 * $top_frequency] - ad_schedule_proc $top_frequency_in_seconds ad_monitor_top + set top_frequency_in_seconds [expr 60 * $top_frequency] + ad_schedule_proc $top_frequency_in_seconds ad_monitor_top } +# Turning this off since it doesn't work properly - vinodk +# see http://openacs.org/sdm/one-baf.tcl?baf_id=1453 -ns_schedule_daily -thread 20 48 ad_monitoring_analyze_tables +#ns_schedule_daily -thread 20 48 ad_monitoring_analyze_tables Index: openacs-4/packages/monitoring/tcl/monitoring-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/monitoring-procs-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/tcl/monitoring-procs-oracle.xql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,37 @@ + + + + oracle8.1.6 + + + + + insert into ad_monitoring_top ( + top_id, + timestamp, + timehour, + load_avg_1, + load_avg_5, + load_avg_15, + memory_real, + memory_free, + memory_swap_in_use, + memory_swap_free + ) values ( + :top_id, + sysdate, + to_char(sysdate, 'HH24'), + :load_1, + :load_5, + :load_15, + :memory_real, + :memory_free, + :memory_swap_in_use, + :memory_swap_free + ) + + + + + + Index: openacs-4/packages/monitoring/tcl/monitoring-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/monitoring-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/tcl/monitoring-procs-postgresql.xql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,37 @@ + + + + postgresql7.1 + + + + + insert into ad_monitoring_top ( + top_id, + timestamp, + timehour, + load_avg_1, + load_avg_5, + load_avg_15, + memory_real, + memory_free, + memory_swap_in_use, + memory_swap_free + ) values ( + :top_id, + current_timestamp, + to_char(current_timestamp, 'HH24')::integer, + :load_1, + :load_5, + :load_15, + :memory_real, + :memory_free, + :memory_swap_in_use, + :memory_swap_free + ) + + + + + + Index: openacs-4/packages/monitoring/tcl/monitoring-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/monitoring-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/tcl/monitoring-procs.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/tcl/monitoring-procs.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -1,9 +1,9 @@ # /packages/monitoring/tcl/monitoring-procs.tcl ad_library { - @author jbank@arsdigita.com [jbank@arsdigita.com] - @creation-date Mon Jan 29 16:50:23 2001 - @cvs-id + @author jbank@arsdigita.com [jbank@arsdigita.com] + @creation-date Mon Jan 29 16:50:23 2001 + @cvs-id $Id$ } if { [llength [info proc apm_package_id_from_key]] == 0 } { @@ -26,13 +26,15 @@ a descriptive quantifier. } { if {$num < 0} { - return [format "%5.1f Kb" [util_commify_number $num]] + return [format "%5.1f Kb" [util_commify_number $num]] } else { - switch [expr {([string length $num] - 1) / 3}] { - 0 { return [append num " Kb"] } - 1 { return [format "%5.1f Mb" [expr {$num / 1000.0}]] } - default { return [format "%5.1f Gb" [util_commify_number [expr {$num / 1000000.0}]]] } -} } } + switch [expr {([string length $num] - 1) / 3}] { + 0 { return [append num " Kb"] } + 1 { return [format "%5.1f Mb" [expr {$num / 1000.0}]] } + default { return [format "%5.1f Gb" [util_commify_number [expr {$num / 1000000.0}]]] } + } + } +} ad_proc ad_monitor_top {} { @@ -55,120 +57,121 @@ resident_memory state cpu_total_time cpu_pct command] # location of the desired top function set top_location [ad_parameter -package_id [monitoring_pkg_id] TopLocation monitoring] - + set top_options [ad_parameter -package_id [monitoring_pkg_id] TopOptions monitoring] + # make sure we have a path to top and that the file exists if { [empty_string_p $top_location] } { - ns_log Error "ad_monitor_top: cannot find top; TopLocation parameter in monitoring - is not defined" - return + ns_log Error "ad_monitor_top: cannot find top; TopLocation parameter in monitoring is not defined" + return } elseif { ![file exists $top_location] } { - ns_log Error "ad_monitor_top: Specified location for top ($top_location) does not exist" - return + ns_log Error "ad_monitor_top: Specified location for top ($top_location) does not exist" + return } - # set top_output [exec $top_location] - if [catch { set top_output [exec $top_location] } errmsg] { + set top_command "exec $top_location $top_options" + + if [catch { set top_output [eval $top_command] } errmsg] { # couldn't exec top at TopLocation if { ![file exists $top_location] } { - ad_return_error "top not found" " - The top procedure could not be found at $top_location: -
 $errmsg 
" - return + ns_log Error "ad_monitor_top: top not found $top_location: $errmsg" + return } - ad_return_error "insufficient top permissions" " - The top procedure at $top_location cannot be run: -
 $errmsg 
" + ns_log Error "ad_monitor_top: top could not be run - $errmsg" return } # else top execution went ok set top_list [split $top_output "\n"] ## Run through the output of top, grab header lines and leave the rest. # number of header lines grabbed - set ctr 0 + set ctr 0 - # greet the database - - # id for this iteration of top-parsing - set top_id [db_string top_id_select "select ad_monitoring_top_top_id.nextval from dual"] + set top_id [db_nextval ad_monitoring_top_top_id] # have we reached the list of process info yet? - set procflag 0 + set procflag 0 foreach line $top_list { - - if { $procflag > 0 } { - #compress multiple spaces - regsub -all {[ ]+} [string trim $line] " " line + if { $procflag > 0 } { + #compress multiple spaces + regsub -all {[ ]+} [string trim $line] " " line set proc_list [split $line] + ns_log Notice "line=$line" - #skip blank lines + #skip blank lines if { [llength $proc_list] < 2 } { continue } if { [llength $proc_list] < 11 } { - ns_log Notice "skipping top process line: + ns_log Notice "skipping top process line: element list shorter than variable list." - continue - } - - #set proc-related vars - set pid [lindex $proc_list 0] - set username [lindex $proc_list 1] - set threads [lindex $proc_list 2] - set priority [lindex $proc_list 3] - set nice [lindex $proc_list 4] - set proc_size [lindex $proc_list 5] - set resident_memory [lindex $proc_list 6] - set state [lindex $proc_list 7] - set cpu_total_time [lindex $proc_list 8] - set cpu_pct [lindex $proc_list 9] - set command [lindex $proc_list 10] + continue + } + + #set proc-related vars + #vinodk: top (procps v.2.0.7 has different columns) + #set pid [lindex $proc_list 0] + #set username [lindex $proc_list 1] + #set threads [lindex $proc_list 2] + #set priority [lindex $proc_list 3] + #set nice [lindex $proc_list 4] + #set proc_size [lindex $proc_list 5] + #set resident_memory [lindex $proc_list 6] + #set state [lindex $proc_list 7] + #set cpu_total_time [lindex $proc_list 8] + #set cpu_pct [lindex $proc_list 9] + #set command [lindex $proc_list 10] - db_dml top_proc_info_insert " - insert into ad_monitoring_top_proc - (proc_id, top_id, pid, command, username, - threads, priority, nice, proc_size, - resident_memory, state, cpu_total_time, cpu_pct) - values - (ad_monitoring_top_proc_proc_id.nextval, :top_id, :pid, - :command, :username, :threads, :priority, :nice, :proc_size, - :resident_memory, :state, :cpu_total_time, :cpu_pct)" + set pid [lindex $proc_list 0] + set username [lindex $proc_list 1] + set threads 0 + set priority [lindex $proc_list 2] + set nice [lindex $proc_list 3] + set proc_size [lindex $proc_list 4] + set resident_memory [lindex $proc_list 5] + set state [lindex $proc_list 7] + set cpu_total_time [lindex $proc_list 10] + set cpu_pct [lindex $proc_list 8] + set command [lindex $proc_list 11] - continue + set proc_id [db_nextval ad_monitoring_top_proc_proc_id] - } elseif { [regexp -nocase {(.*PID.USERNAME.*)} $line match top_header] } { - ## this is the start of proc info lines + db_dml top_proc_info_insert "*SQL*" + + continue + + } elseif { [regexp -nocase {(.*PID.USER.*)} $line match top_header] } { + ns_log notice "vk1" + ## this is the start of proc info lines incr procflag - continue + continue } elseif { [regexp -nocase {load av[a-z]*: (.*)} $line match load] } { - ## this is the load header - incr ctr + ## this is the load header + incr ctr - # remove commas, multiple spaces - regsub -all {,} [string trim $load] "" load - regsub -all {[ ]+} $load " " load + # remove commas, multiple spaces + regsub -all {,} [string trim $load] "" load + regsub -all {[ ]+} $load " " load - set load_list [split $load " "] - - # We keep all three load avgs, ignore the time at the end of the line - set load_1 [lindex load_list 0] - set load_5 [lindex load_list 1] - set load_15 [lindex load_list 2] + set load_list [split $load " "] - # send out any high-load alerts - if { $load_5 > [ad_parameter -package_id [monitoring_pkg_id] LoadAverageAlertThreshold monitoring 2.0] } { - wd_email_notify_list "High Load Average on [ad_url]" \ - "The load average over the last 5 minutes for [ad_url] was $load_5" - } + # We keep all three load avgs, ignore the time at the end of the line + set load_1 [lindex $load_list 0] + set load_5 [lindex $load_list 1] + set load_15 [lindex $load_list 2] - } elseif { [regexp -nocase {mem[a-z]*: (.*)} $line match memory] } { - ## this is the memory header - incr ctr + # send out any high-load alerts + if { $load_5 > [ad_parameter -package_id [monitoring_pkg_id] LoadAverageAlertThreshold monitoring 2.0] } { + wd_email_notify_list "High Load Average on [ad_url]" \ + "The load average over the last 5 minutes for [ad_url] was $load_5" + } + + } elseif { [regexp -nocase {mem[a-z]*: (.*)} $line match memory] } { + ## this is the memory header foreach mem [split $memory ","] { regexp {^ *([^ ]*) (.*)} $mem match amount type set amount [string trim [string toupper $amount]] - # convert all mem values to Kilobytes + # convert all mem values to Kilobytes regsub {K$} $amount "" amount regsub {M$} $amount "000" amount @@ -178,29 +181,52 @@ "free" { set memory_free $amount } "swap free" { set memory_swap_free $amount } "swap in use" { set memory_swap_in_use $amount } + "total" { set memory_real $amount } } } - } - if {$ctr == 2 } { - ## we have all the header information we currently store. - ## we should also store the rest of top's output... - ## some of it can be gotten from the zoom package. - db_dml top_misc_info_insert "insert into ad_monitoring_top - (top_id, timestamp, timehour, load_avg_1, load_avg_5, load_avg_15, - memory_real, memory_free, memory_swap_in_use, memory_swap_free) - values - (:top_id, sysdate, to_char(sysdate, 'HH24'), :load_1, :load_5, :load_15, - :memory_real, :memory_free, :memory_swap_in_use, :memory_swap_free)" - incr ctr - } - # end of the foreach loop + # my version of top has Mem and Swap on different lines + # don't increment ctr until we get both + if {[info exists memory_real] && [info exists memory_swap_free]} { + incr ctr + } + } elseif { [regexp -nocase {swa[a-z]*: (.*)} $line match memory] } { + ## this is the swap header + foreach mem [split $memory ","] { + regexp {^ *([^ ]*) (.*)} $mem match amount type + set amount [string trim [string toupper $amount]] + # convert all mem values to Kilobytes + regsub {K$} $amount "" amount + regsub {M$} $amount "000" amount + + set type [string trim [string tolower $type]] + switch $type { + "free" { set memory_swap_free $amount } + "used" { set memory_swap_in_use $amount } + } + } + + # my version of top has Mem and Swap on different lines + # don't increment ctr until we get both + if {[info exists memory_real] && [info exists memory_swap_free]} { + incr ctr + } + } + + if {$ctr == 2 } { + ## we have all the header information we currently store. + ## we should also store the rest of top's output... + ## some of it can be gotten from the zoom package. + db_dml top_misc_info_insert "*SQL" + incr ctr + } + # end of the foreach loop } if { $ctr < 2 } { - # didn't even get load and memory lines from top - ns_log Error "ad_monitor_top: Cannot parse output from top" - return + # didn't even get load and memory lines from top + ns_log Error "ad_monitor_top: Cannot parse output from top" + return } } @@ -224,15 +250,15 @@ # Are we even doing this? if {[ad_parameter -package_id [monitoring_pkg_id] AutoAnalyzeP monitoring 0]==0} { - ns_log notice "ad_monitoring_analyze_tables: Not Analyzing Tables" - return + ns_log notice "ad_monitoring_analyze_tables: Not Analyzing Tables" + return } #how many days should a complete scan take set numdays [ad_parameter -package_id [monitoring_pkg_id] NumDaysToEstAllRows monitoring 7] if {$numdays < 1} { - ns_log error "ad_monitoring_analyze_tables: Parameter NumDaysToEstAllRows cannot be less than 1." - return + ns_log error "ad_monitoring_analyze_tables: Parameter NumDaysToEstAllRows cannot be less than 1." + return } # grab a handle @@ -262,27 +288,27 @@ # Now we go through each item foreach table_item $alltables { - # Variables to be used JAva + # Variables to be used JAva - set entry_id [lindex $table_item 2] - set table_name [lindex $table_item 0] - set percent [lindex $table_item 1] - - #The string to execute. - set execstr "analyze table :table_name estimate statistics sample :percent percent" - + set entry_id [lindex $table_item 2] + set table_name [lindex $table_item 0] + set percent [lindex $table_item 1] + + #The string to execute. + set execstr "analyze table :table_name estimate statistics sample :percent percent" + # for some reason this failed.. probably cause the table doesn't exists # anymore - ns_log notice "Analyzing $table_name.." - if {[catch {db_dml table_analyze $execstr} errmsg]} { - # Look up the table in user_tables - if { ![db_table_exists $table_name] } { - # The table wasn't listed.. so we disable this entry - db_dml one_table_entry_disable_monitoring "update ad_monitoring set enabled_p='f' - where table_entry_id=:entry_id" + ns_log notice "Analyzing $table_name.." + if {[catch {db_dml table_analyze $execstr} errmsg]} { + # Look up the table in user_tables + if { ![db_table_exists $table_name] } { + # The table wasn't listed.. so we disable this entry + db_dml one_table_entry_disable_monitoring "update ad_monitoring set enabled_p='f' + where table_entry_id=:entry_id" } else { - ns_log error "ad_monitoring_analyze_tables: Error while executing: $execstr" - } + ns_log error "ad_monitoring_analyze_tables: Error while executing: $execstr" + } } else { #Change the last estimated, and continue looping db_dml one_table_entry_update_last_estimated " @@ -294,5 +320,3 @@ } db_release_unused_handles } - - Index: openacs-4/packages/monitoring/tcl/monitoring-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/monitoring-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/tcl/monitoring-procs.xql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,41 @@ + + + + + + + insert into ad_monitoring_top_proc ( + proc_id, + top_id, + pid, + command, + username, + threads, + priority, + nice, + proc_size, + resident_memory, + state, + cpu_total_time, + cpu_pct + ) values ( + :proc_id, + :top_id, + :pid, + :command, + :username, + :threads, + :priority, + :nice, + :proc_size, + :resident_memory, + :state, + :cpu_total_time, + :cpu_pct + ) + + + + + + Index: openacs-4/packages/monitoring/tcl/watchdog-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/watchdog-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/tcl/watchdog-init.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/tcl/watchdog-init.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -1,20 +1,35 @@ # /packages/monitoring/tcl/watchdog-init.tcl ad_library { - @author jbank@arsdigita.com [jbank@arsdigita.com] - @creation-date Tue Jan 30 16:35:55 2001 - @cvs-id + @author jbank@arsdigita.com [jbank@arsdigita.com] + @author Andrew Piskorski (atp@piskorski.com) + @creation-date Tue Jan 30 16:35:55 2001 + @cvs-id $Id$ } -ns_share -init {set wd_installed_p 0} wd_installed_p +if { ![nsv_exists . wd_installed_p] } { + nsv_set . wd_installed_p 0 +} -if {! $wd_installed_p} { - if {[monitoring_pkg_id] != 0} { +if { ![nsv_get . wd_installed_p] } { + if { [monitoring_pkg_id] != 0 } { + set check_frequency [wd_email_frequency] - if {$check_frequency > 0} { - ad_schedule_proc [expr 60 * $check_frequency] wd_mail_errors - ns_log Notice "Scheduling watchdog" + if { $check_frequency > 0 } { + + # If we schedule Watchdog e.g. every 15 minutes, it will first + # run 15 minutes after server start. Which means that if we + # have some nasty error which is causing the server to restart + # every 2 minutes, Watchdog will never run. Therefore, we also + # run it once immediately at server startup: + # --atp@piskorski.com, 2002/04/08 22:09 EDT + + ad_schedule_proc -once t 0 {wd_mail_errors} + + ad_schedule_proc [expr 60 * $check_frequency] {wd_mail_errors} + ns_log Notice "Scheduled watchdog to run every '$check_frequency' minutes." } - set wd_installed_p 1 + nsv_set . wd_installed_p 1 } + } Index: openacs-4/packages/monitoring/tcl/watchdog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/tcl/watchdog-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/tcl/watchdog-procs.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/tcl/watchdog-procs.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -13,48 +13,76 @@ and sent any error messages to ad_system_owner. @author + @author Andrew Piskorski (atp@piskorski.com) @creation-date Nov 28, 1999 - @cvs-id watchdog-defs.tcl,v 3.9.2.4 2000/07/31 00:44:59 lars Exp + @cvs-id $Id$ } -ad_proc wd_errors {{num_minutes ""} {num_bytes "200000"}} "" { +ad_proc wd_errors {{ + -external_parser_p 0 + -num_minutes "" + -num_bytes {1024000} +}} { + TODO: Docs... +} { + set proc_name {wd_errors} + set options "" if ![empty_string_p $num_minutes] { - validate_integer "Minutes" "$num_minutes" + validate_integer "Minutes" "$num_minutes" set options "-${num_minutes}m " } else { - validate_integer "Bytes" "$num_bytes" + validate_integer "Bytes" "$num_bytes" set options "-${num_bytes}b " } - set default_command "[acs_package_root_dir monitoring]/bin/aolserver-errors.pl" - set command [ad_parameter -package_id [monitoring_pkg_id] WatchDogParser monitoring $default_command] + # TODO: Rather than using external_parser_p flag, my want to do the + # external_parser_p stuff if the WatchDogParser parameter is empty + # string. --atp@piskorski.com, 2002/04/08 14:25 EDT - if { ![file exists $command] } { - ns_log Notice "watchdog(wd_errors): Can't find WatchDogParser: $command doesn't exist" + if { $external_parser_p } { + set default_command "[acs_package_root_dir monitoring]/bin/aolserver-errors.pl" + set command [ad_parameter -package_id [monitoring_pkg_id] WatchDogParser monitoring $default_command] + + if { ![file exists $command] } { + ns_log Notice "Watchdog($proc_name): Can't find WatchDogParser: $command doesn't exist" + } else { + # This has been changed from the previous version's concat + # because it did not work. Some quick testing + # did not reveal an elegant solution, so we're going back + # to the old less-elegant-but-functional solution + + if { [catch { set result [exec $command $options [ns_info log]] } err_msg] } { + global errorInfo + ns_log Error "Watchdog($proc_name): $errorInfo" + return "" + } else { + return $result + } + + } + } else { - # This has been changed from the previous version's concat - # because it did not work. Some quick testing - # did not reveal an elegant solution, so we're going back - # to the old less-elegant-but-functional solution - if { [catch { set result [exec $command $options [ns_info log]] } err_msg] } { - ns_log error "Watchdog(wd_errors): $err_msg" - return "" - } else { - return $result - } + return [wd_aolserver_errors -num_minutes $num_minutes -num_bytes $num_bytes [ns_info log]] } } + ad_proc wd_email_frequency {} "" { - # in minutes - return [ad_parameter -package_id [monitoring_pkg_id] WatchDogFrequency monitoring 300] + # Frequency is in minutes. First checks value from ad_parameter, + # if no such parameter, uses value from AOLserver nsd.tcl config + # file, if no such parameter, uses default of 15 minutes: + # --atp@piskorski.com, 2002/04/08 12:49 EDT + + return [ad_parameter -package_id [monitoring_pkg_id] WatchDogFrequency monitoring \ + [ns_config "ns/server/[ns_info server]/acs/monitoring" WatchDogFrequency 15]] } ad_proc wd_people_to_notify {} "" { set people_to_notify [ad_parameter_all_values_as_list -package_id [monitoring_pkg_id] PersontoNotify monitoring] + if [empty_string_p $people_to_notify] { return [ad_system_owner] } else { @@ -63,18 +91,17 @@ } ad_proc wd_mail_errors {} "" { - + set proc_name {wd_mail_errors} + set num_minutes [wd_email_frequency] - - ns_log Notice "Looking for errors..." - - set errors [wd_errors $num_minutes] - + ns_log Notice "Watchdog($proc_name): Looking for errors..." + set errors [wd_errors -num_minutes $num_minutes] + if {[string length $errors] > 50} { - ns_log Notice "Errors found" - # Let's put the url to this server in the email message - # to make it crystal clear which server is having problems - set message " + ns_log Notice "Watchdog($proc_name): Errors found." + # Let's put the url to this server in the email message + # to make it crystal clear which server is having problems + set message " ([ad_url]) $errors" @@ -88,9 +115,147 @@ } { set system_owner [ad_system_owner] foreach person [wd_people_to_notify] { - ns_sendmail $person $system_owner $subject $message + ns_sendmail $person $system_owner $subject $message } } - +ad_proc wd_aolserver_errors {{ + -num_minutes {} + -num_bytes {1024000} +} log_file } { + Tcl version of packages/monitoring/bin/aolserver-errors.pl, to run + inside of AOLserver rather than forking a Perl script. +

+ Saves its run-to-run state in $lastreadfile, so AOLserver must have + write permission to the directory where $log_file is located. + + @author David Walker (openacs@grax.com) + @author Andrew Piskorski (atp@piskorski.com) +} { + + if { ![empty_string_p $num_minutes] } { + validate_integer {Minutes} $num_minutes + } elseif { [empty_string_p $num_bytes] } { + set num_bytes 0 + } else { + validate_integer {Bytes} $num_bytes + } + + set lastreadfile "${log_file}.lastread" + + if {[file exists $lastreadfile]} { + source "${lastreadfile}" + + # That will set the lastread (which is bytes) and lastread_time + # (which is a string like 'Tue Apr 09 18:44:49 2002') variables. + } + set log_file_size [file size $log_file] + + if { ![info exists lastread] || $lastread > $log_file_size } { + set lastread 0 + set lastread_time "First Run" + + # If the log has been rolled, presumably it will now be smaller + # in size than it was last time. So in that case, always read + # from the beginning of the file. + # + # TODO: But, it isn't GUARANTEED that it will always be smaller. + # Is there any other way for us to detect if the log has been + # rolled or otherwise fooled with? Save the first line from the + # log into our $lastreadfile, if the first line in the current + # log is different, then we know the log has been rolled. + # --atp@piskorski.com, 2002/04/09 13:13 EDT + } + + # TODO: num_minutes is currently being ignored. Change that. + # --atp@piskorski.com, 2002/04/08 18:33 EDT + + # If the log grew by more than num_bytes since the last run, then + # we review only the LAST num_bytes of the log, where the "end" of + # the log is the point that WAS the end at the time we set + # log_file_size, above. To always read everything, set num_bytes + # to 0: + + if { $num_bytes > 0 } { + set sizediff [expr {$log_file_size - $lastread}] + + if { $sizediff > $num_bytes } { + set lastread [expr {$log_file_size - $num_bytes}] + append output "Log file grew by [expr {round(100.0 * [expr {$sizediff / 1024.0 / 1024.0}]) / 100.0}] megabytes.\nReporting on the last $num_bytes bytes of log:\n" + } + } + + set fh [open $log_file] + seek $fh $lastread + + set in_error_p 0 + set in_following_notice_p 0 + + append output "Errors since $lastread_time\n"; + + # Note that in the while loop below, if we simply read till EOF we + # will have a race condition with the other threads writing to the + # log - bad! A stern chase is a long chase, so if the log is + # growing like crazy because our server is, say, looping over and + # over on an error (yes, I've seen it happen...), by the time this + # thread catches up, we may easily end up trying to email 50+ MB of + # error messages. We avoid this race condition by checking our + # position in the file with tell: + # + # --atp@piskorski.com, 2002/07/26 00:46 EDT + + while { ![eof $fh] && ([tell $fh] <= $log_file_size) } { + gets $fh thisline + + # Each line in the AOLserver error (server) log looks like this: + # [13/Jul/2002:00:43:29][2074.5][-sched-] Notice: Running scheduled proc wd_mail_errors... + + # Using non-greedy like this works: + # {^\[(.*?)\]\[(.*?)\]\[(.*?)\](.*)$} + # but let's use negated character classes instead: + + if { [regexp -expanded -- { + ^\[([^\]]*)\] + \[([^\]]*)\] + \[([^\]]*)\] + (.*)$ + } $thisline xxx var1 var2 var3 var4] } { + set time $var1 + set message [string trim $var4] + + if {[string first "Error:" $message] == 0} { + append output "\n$time\n $message\n"; + set in_error_p 1 + set in_following_notice_p 0 + } elseif {[string first "Notice:" $message] == 0} { + if { $in_error_p } { + set in_following_notice_p 1 + append output " $message\n" + } else { + set in_following_notice_p 0 + } + set in_error_p 0 + } else { + set in_error_p 0 + set in_following_notice_p 0 + } + } else { + # The regexp didn't match, so whatever this line is, it's NOT + # the start of a normal AOLserver ns_log message. + + if { $in_error_p || $in_following_notice_p } { + append output "$thisline\n" + } + } + } + set file_read_size [tell $fh] + close $fh + + set fh [open $lastreadfile w] + puts $fh "set lastread \"${file_read_size}\"" + puts $fh "set lastread_time \"[ns_fmttime [clock seconds]]\"" + close $fh + + return $output +} Index: openacs-4/packages/monitoring/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/index-oracle.xql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,18 @@ + + + + oracle8.1.6 + + + + + select site_node.url(s.node_id) as url + from site_nodes s + where s.object_id = :dev_support_id + and rownum = 1 + + + + + + Index: openacs-4/packages/monitoring/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/index-postgresql.xql 19 Aug 2002 23:10:28 -0000 1.1 @@ -0,0 +1,18 @@ + + + + postgresql7.1 + + + + + select site_node__url(s.node_id) as url + from site_nodes s + where s.object_id = :dev_support_id + limit 1 + + + + + + Index: openacs-4/packages/monitoring/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/index.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/index.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -1,22 +1,20 @@ ad_page_contract { - @cvs-id index.tcl,v 3.5.2.5 2000/08/23 23:49:54 mbryzek Exp + Show all the links to Monitoring sub-modules + @cvs-id $Id$ } {} set dev_support_link "" set dev_support_id [apm_package_id_from_key "acs-developer-support"] if { $dev_support_id != 0 } { - set dev_support_url [db_string get_package_url { - select site_node.url(s.node_id) as url - from site_nodes s - where s.object_id = :dev_support_id - and rownum = 1 - } -default ""] + set dev_support_url [db_string get_package_url { *SQL* } -default ""] if { ![empty_string_p $dev_support_url] } { set dev_support_link "

  • Developer Support Request Information" } } +# vinodk: FIXME: show only those links specific to the running database + doc_return 200 text/html "[ad_header "Monitoring [ad_system_name]"]

    Monitoring [ad_system_name]

    Index: openacs-4/packages/monitoring/www/monitor.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/monitor.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/monitor.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/monitor.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -3,9 +3,10 @@ ad_page_contract { @author Philip Greenspun @creation-date - @cvs-id monitor.tcl,v 3.1.2.3 2000/08/05 16:15:53 luke Exp -} {} + @cvs-id $Id$ +} { +} set connections [ns_server active] @@ -72,7 +73,6 @@ append whole_page "[join $connection ]\n" } - append whole_page " [ad_footer] " Index: openacs-4/packages/monitoring/www/registered-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/registered-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/registered-procs.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/registered-procs.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -4,7 +4,7 @@ Displays a list of registered procedures. @author Jon Salz (jsalz@mit.edu) - @cvs-id registered-procs.tcl,v 3.1.2.2 2000/07/21 03:57:38 ron Exp + @cvs-id $Id$ } { match_method:optional match_path:optional @@ -17,7 +17,7 @@ set match_path "(any)" } else { if { ![regexp {^/} $match_path] } { - set match_path "/$match_path" + set match_path "/$match_path" } } @@ -63,33 +63,33 @@ set bgcolors { white #E0E0E0 } foreach meth $match_method { foreach f [nsv_get rp_registered_procs "$meth"] { - set bgcolor [lindex $bgcolors [expr { $counter % [llength $bgcolors] }]] - incr counter - - set method [lindex $f 0] - set path [lindex $f 1] - set proc [lindex $f 2] - set args [lindex $f 3] - if { $args == "" } { - set args " " - } - set debug [ad_decode [lindex $f 4] "t" "Yes" "No"] - set inherit [ad_decode [lindex $f 5] "f" "Yes" "No"] - set description [lindex $f 6] - set file [file tail [lindex $f 7]] - if { [empty_string_p $file] } { - set file " " - } - if { $match_path == "(any)" || \ - [string match $path $match_path] || \ - ($inherit == "Yes" && [string match "$path/*" $match_path]) } { - append output "" - foreach name { method path proc file args inherit debug } { - append output "[set $name]" - } - append output "\n" - } + set bgcolor [lindex $bgcolors [expr { $counter % [llength $bgcolors] }]] + incr counter + + set method [lindex $f 0] + set path [lindex $f 1] + set proc [lindex $f 2] + set args [lindex $f 3] + if { $args == "" } { + set args " " } + set debug [ad_decode [lindex $f 4] "t" "Yes" "No"] + set inherit [ad_decode [lindex $f 5] "f" "Yes" "No"] + set description [lindex $f 6] + set file [file tail [lindex $f 7]] + if { [empty_string_p $file] } { + set file " " + } + if { $match_path == "(any)" || \ + [string match $path $match_path] || \ + ($inherit == "Yes" && [string match "$path/*" $match_path]) } { + append output "" + foreach name { method path proc file args inherit debug } { + append output "[set $name]" + } + append output "\n" + } + } } append page_content "$output Index: openacs-4/packages/monitoring/www/scheduled-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/scheduled-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/scheduled-procs.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/scheduled-procs.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -4,7 +4,7 @@ Displays a list of scheduled procedures. @author Jon Salz (jsalz@mit.edu) - @cvs-id scheduled-procs.tcl,v 3.2.10.2 2000/07/21 03:57:38 ron Exp + @cvs-id $Id$ } { } @@ -40,11 +40,11 @@ set next_run_a [expr { [lindex $a 5] + [lindex $a 2] }] set next_run_b [expr { [lindex $b 5] + [lindex $b 2] }] if { $next_run_a < $next_run_b } { - return -1 + return -1 } elseif { $next_run_a > $next_run_b } { - return 1 + return 1 } else { - return [string compare [lindex $a 3] [lindex $b 3]] + return [string compare [lindex $a 3] [lindex $b 3]] } } @@ -58,7 +58,7 @@ set proc [lindex $proc_info 3] set args [lindex $proc_info 4] if { $args == "" } { - set args " " + set args " " } set time [lindex $proc_info 5] set count [lindex $proc_info 6] @@ -69,15 +69,15 @@ append page_content "" foreach name { proc args } { - append page_content "[set $name]" + append page_content "[set $name]" } append page_content "$count" foreach name { last_run next_run } { - append page_content "[set $name]" + append page_content "[set $name]" } append page_content "$next_run_in" foreach name { thread once debug } { - append page_content "[set $name]" + append page_content "[set $name]" } append page_content "\n" } Index: openacs-4/packages/monitoring/www/startup-log.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/startup-log.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/startup-log.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/startup-log.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -4,17 +4,17 @@ Displays a log (between the "AOLserver starting" and "AOLserver running" lines). @author Jon Salz (jsalz@mit.edu) - @cvs-id startup-log.tcl,v 3.2.2.2 2000/07/21 03:57:38 ron Exp + @cvs-id $Id$ } { { errors_only_p 1 } } set dimensional_list { { errors_only_p "Show:" 1 { - { 1 "Errors Only" } - { 0 "All Events" } - } + { 1 "Errors Only" } + { 0 "All Events" } + } } } @@ -43,23 +43,23 @@ # last "AOLserver/xxx starting" line. set offset [expr { $initial_error_log_length - 16384 }] if { $offset < 0 } { - set offset 0 + set offset 0 } set last_line $offset set start_offset $offset seek $error_log $offset start while { [gets $error_log line] >= 0 } { - if { [regexp {AOLserver/[^ ]+ starting} $line] } { - set start_offset $last_line - } - set last_line [tell $error_log] - if { $last_line > $initial_error_log_length } { - break - } + if { [regexp {AOLserver/[^ ]+ starting} $line] } { + set start_offset $last_line + } + set last_line [tell $error_log] + if { $last_line > $initial_error_log_length } { + break + } } - + nsv_set acs_properties error_log_start_offset $start_offset } @@ -68,26 +68,26 @@ set error_p 0 while { [gets $error_log line] >= 0 } { if { [regexp {^\[[^\]]+\]\[[^\]]+\]\[[^\]]+\] ([^:]+)} $line "" status] } { - if { [string equal $status "Warning"] || [string equal $status "Error"] } { - set error_p 1 - } else { - set error_p 0 - } + if { [string equal $status "Warning"] || [string equal $status "Error"] } { + set error_p 1 + } else { + set error_p 0 + } } if { $error_p } { - if { $errors_only_p } { - append out "[ns_quotehtml $line]\n" - } else { - append out "[ns_quotehtml $line]\n" - } + if { $errors_only_p } { + append out "[ns_quotehtml $line]\n" + } else { + append out "[ns_quotehtml $line]\n" + } } elseif { !$errors_only_p } { - append out "[ns_quotehtml $line]\n" + append out "[ns_quotehtml $line]\n" } if { [regexp {AOLserver/[^ ]+ running} $line] } { - break + break } if { [tell $error_log] > $error_log_length } { - break + break } } close $error_log Index: openacs-4/packages/monitoring/www/cassandracle/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/cassandracle/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/cassandracle/index.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/cassandracle/index.tcl 19 Aug 2002 23:10:28 -0000 1.2 @@ -17,7 +17,7 @@
  • Log into Oracle via sqlplus
  • connect internal;
  • @ [acs_package_root_dir monitoring]/sql/cassandracle.sql -
  • grant ad_cassandracle to [ns_config "ns/db/pool/main" User]; +
  • grant ad_cassandracle to [ns_config "ns/db/pool/main" User][ns_config "ns/db/pool/pool1" User];
  • restart-aolserver [ns_info server] " return Index: openacs-4/packages/monitoring/www/configuration/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/configuration/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/configuration/index.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/configuration/index.tcl 19 Aug 2002 23:10:29 -0000 1.2 @@ -4,7 +4,7 @@ Displays some basic information about this installation of AOLServer: IP Address, System Name, and System Owner. - @cvs-id index.tcl,v 3.1.2.2 2000/07/21 03:57:41 ron Exp + @cvs-id $Id$ } { } Index: openacs-4/packages/monitoring/www/top/details-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/details-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/top/details-oracle.xql 19 Aug 2002 23:10:29 -0000 1.1 @@ -0,0 +1,65 @@ + + + + oracle8.1.6 + + + + + select to_char(sysdate,'HH24') from dual + + + + + + + + + (24 - (:end_time - :current_hour)) / 24 + + + + + + + + select pid, command, username, + $proc_time_sql, + count(*) as count, + round(avg(threads),0) as threads, + round(avg(to_number(rtrim(cpu_pct, '%'))),2) as cpu_pct + from (select * from ad_monitoring_top_proc + where to_number(rtrim(cpu_pct, '%')) > :min_cpu_pct) p, + (select * from ad_monitoring_top where $time_clause) t + where p.top_id = t.top_id + and $details_clause + group by pid, command, username, $proc_group_by + [ad_order_by_from_sort_spec $orderby $top_proc_table_def] + + + + + + + + round(nvl(avg(load_avg_1), 0), 2) as load_average, + round(nvl(avg(memory_free),0), -2) as memory_free_average, + round(nvl(avg(memory_swap_free), 0), -2) as memory_swap_free_average, + round(nvl(avg(memory_swap_in_use),0), -2) as memory_swap_in_use_average + + + + + + + + select count(*) + from (select * from ad_monitoring_top where $time_clause) t, + (select * from ad_monitoring_top_proc + where to_number(rtrim(cpu_pct, '%')) > :min_cpu_pct) p + where t.top_id = p.top_id + and $details_clause + + + + + Index: openacs-4/packages/monitoring/www/top/details-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/details-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/top/details-postgresql.xql 19 Aug 2002 23:10:29 -0000 1.1 @@ -0,0 +1,65 @@ + + + + postgresql7.1 + + + + + select to_char(current_timestamp,'HH24') + + + + + + + + + (24 - (:end_time ::integer - $current_hour ::integer)) / 24 + + + + + + + + select pid, command, username, + $proc_time_sql, + count(*) as count, + round(avg(threads),0) as threads, + round(avg(to_number(rtrim(cpu_pct, '%'), '9999D99')), 2) as cpu_pct + from ( select * from ad_monitoring_top_proc + where to_number(rtrim(cpu_pct, '%'), '9999D99') > :min_cpu_pct ) p, + (select * from ad_monitoring_top $time_clause) t + where p.top_id = t.top_id + and $details_clause + group by pid, command, username, $proc_group_by + [ad_order_by_from_sort_spec $orderby $top_proc_table_def] + + + + + + + + round(coalesce(avg(load_avg_1), 0), 2) as load_average, + round(coalesce(avg(memory_free),0), -2) as memory_free_average, + round(coalesce(avg(memory_swap_free), 0), -2) as memory_swap_free_average, + round(coalesce(avg(memory_swap_in_use),0), -2) as memory_swap_in_use_average + + + + + + + + select count(*) + from (select * from ad_monitoring_top $time_clause) t, + (select * from ad_monitoring_top_proc + where to_number(rtrim(cpu_pct, '%'), '9999D99') > :min_cpu_pct) p + where t.top_id = p.top_id + and $details_clause + + + + + Index: openacs-4/packages/monitoring/www/top/details.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/details.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/top/details.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/top/details.tcl 19 Aug 2002 23:10:29 -0000 1.2 @@ -47,37 +47,37 @@ set top_system_avg_table_def { {time "hour" {} \ - {$time}} + {$time}} {load_average "load" {} {}} {memory_free_average "free mem" {} \ - {[ad_monitor_format_kb $memory_free_average]}} + {[ad_monitor_format_kb $memory_free_average]}} {memory_swap_free_average "free swap" {} \ - {[ad_monitor_format_kb $memory_swap_free_average]}} + {[ad_monitor_format_kb $memory_swap_free_average]}} {memory_swap_in_use_average "used swap" {} \ - {[ad_monitor_format_kb $memory_swap_in_use_average]}} + {[ad_monitor_format_kb $memory_swap_in_use_average]}} {count "count" {} {}} } set top_system_table_def { {time "time" {} {}} {load_average "load" {} {}} {memory_free_average "free mem" {} \ - {[ad_monitor_format_kb $memory_free_average]}} + {[ad_monitor_format_kb $memory_free_average]}} {memory_swap_free_average "free swap" {} \ - {[ad_monitor_format_kb $memory_swap_free_average]}} + {[ad_monitor_format_kb $memory_swap_free_average]}} {memory_swap_in_use_average "used swap" {} \ - {[ad_monitor_format_kb $memory_swap_in_use_average]}} + {[ad_monitor_format_kb $memory_swap_in_use_average]}} } set top_proc_table_def { {time "Time" {} {}} {threads "Thr" {} {}} {command "Command" {} \ - {$command}} + {$command}} {username "Username" {} \ - {$username}} + {$username}} {pid "PID" {} \ - {$pid}} + {$pid}} {cpu_pct "CPU" {} {}} {count "Cnt" {} {}} } @@ -95,27 +95,26 @@ set n_days "all" } if { ![string equal $key "hour"] } { - set time_clause "timehour >= :start_time - and timehour < :end_time" - + set time_clause [db_map time_clause_1] + if { [string compare $n_days "all"] != 0 } { - # Need to multiply n_days by ($end_time-to_char(sysdate,'HH24'))/24 - # for accurate current snapshots. That is, displaying back in time - # needs to be relative to the selected end_time, not to sysdate. - set current_hour [db_string mon_current_hour \ - "select to_char(sysdate,'HH24') from dual"] - if { $end_time > $current_hour } { - # we correct for the last day in the query if the end time - # is later than the current time. - # TODO: need to add this into the query? - set hour_correction " + (24 - (:end_time - :current_hour)) / 24 " - } else { - set hour_correction "" - } + # Need to multiply n_days by ($end_time-to_char(sysdate,'HH24'))/24 + # for accurate current snapshots. That is, displaying back in time + # needs to be relative to the selected end_time, not to sysdate. + set current_hour [db_string mon_current_hour { *SQL* } ] + + if { $end_time > $current_hour } { + # we correct for the last day in the query if the end time + # is later than the current time. + # TODO: need to add this into the query? + set hour_correction [db_map hour_correction] + } else { + set hour_correction "" + } } } else { # we're looking at a specific hour of a specific day, no need to filter - set time_clause "1 = 1" + set time_clause "where 1 = 1" } ### 2. Create the sql to fill the ad_tables, given the detailed constraint. @@ -124,22 +123,25 @@ set proc_time_sql "to_char(timestamp, 'MM/DD HH24') || ':00' as time" switch $key { - day { set details_clause "to_char(timestamp, 'Mon DD') = :value" - set system_time_sql "to_char(timestamp, 'MM/DD HH24') || ':00' as time" - set system_group_by "to_char(timestamp, 'MM/DD HH24')" + day { + set details_clause "to_char(timestamp, 'Mon DD') = :value" + set system_time_sql "to_char(timestamp, 'MM/DD HH24') || ':00' as time" + set system_group_by "to_char(timestamp, 'MM/DD HH24')" } - hour { set details_clause "to_char(timestamp, 'MM/DD HH24') || ':00' = :value" - set system_time_sql "to_char(timestamp, 'MM/DD HH24:MI') as time" - set system_group_by "timestamp" - # if you want to show every single proc: - if {[string match $showall "t"]} { - set proc_time_sql "to_char(timestamp, 'MM/DD HH24:MI') as time" - set proc_group_by "timestamp" - } + hour { + set details_clause "to_char(timestamp, 'MM/DD HH24') || ':00' = :value" + set system_time_sql "to_char(timestamp, 'MM/DD HH24:MI') as time" + set system_group_by "timestamp" + # if you want to show every single proc: + if {[string match $showall "t"]} { + set proc_time_sql "to_char(timestamp, 'MM/DD HH24:MI') as time" + set proc_group_by "timestamp" + } } - default { set details_clause "$key = :value" - set proc_time_sql "to_char(timestamp, 'MM/DD HH24:MI') as time" - set proc_group_by "timestamp" + default { + set details_clause "$key = :value" + set proc_time_sql "to_char(timestamp, 'MM/DD HH24:MI') as time" + set proc_group_by "timestamp" } } @@ -148,37 +150,12 @@ ## the $xxx_group_by clause groups either by hour or by second ## (i.e., not at all). -set proc_query " - select pid, command, username, - $proc_time_sql, - count(*) as count, - round(avg(threads),0) as threads, - round(avg(to_number(rtrim(cpu_pct, '%'))),2) as cpu_pct - from (select * from ad_monitoring_top_proc - where to_number(rtrim(cpu_pct, '%')) > :min_cpu_pct) p, - (select * from ad_monitoring_top where $time_clause) t - where p.top_id = t.top_id - and $details_clause - group by pid, command, username, $proc_group_by - [ad_order_by_from_sort_spec $orderby $top_proc_table_def] -" +set proc_query [db_map proc_query] if { [string match $key "hour"] || [string match $key "day"] } { - set load_and_memory_averages_sql "round(nvl(avg(load_avg_1), 0), 2) as load_average, - round(nvl(avg(memory_free),0), -2) as memory_free_average, - round(nvl(avg(memory_swap_free), 0), -2) as memory_swap_free_average, - round(nvl(avg(memory_swap_in_use),0), -2) as memory_swap_in_use_average" + set load_and_memory_averages_sql [db_map load_and_memory_averages_sql] - set system_query " - select $load_and_memory_averages_sql, - count(*) as count, - $system_time_sql - from ad_monitoring_top - where $time_clause - and $details_clause - group by $system_group_by - [ad_order_by_from_sort_spec $orderbysystem $top_system_table_def] - " + set system_query [db_map system_query] } ### Begin returning the page. @@ -201,20 +178,24 @@ set n_days_list [list] foreach n [list 1 2 3 7 14 31 all] { if { $n == $n_days } { - lappend n_days_list "$n" + lappend n_days_list "$n" } else { - lappend n_days_list "$n" } } set start_select "" set end_select "" for { set i 0 } { $i < 25 } { incr i } { - if { $i == 0 || $i == 24} { set text "Midnight" - } elseif { $i == 12 } { set text "Noon" - } elseif { $i > 12 } { set text "[expr {$i - 12}] pm" - } else { set text "$i am" + if { $i == 0 || $i == 24} { + set text "Midnight" + } elseif { $i == 12 } { + set text "Noon" + } elseif { $i > 12 } { + set text "[expr {$i - 12}] pm" + } else { + set text "$i am" } append start_select "
  • over the past $n_days days + [ad_admin_footer]" doc_return 200 text/html $page_content return @@ -311,18 +285,18 @@ # the right orderby variable if { [string match $key "hour"] } { append page_content "[ad_table -Tsuffix system -bind $bind_vars \ - unused $system_query $top_system_table_def] + unused $system_query $top_system_table_def]
    " } elseif { [string match $key "day"] } { append page_content "[ad_table -Tsuffix system -bind $bind_vars \ - unused $system_query $top_system_avg_table_def] + unused $system_query $top_system_avg_table_def]
    " } append page_content "[ad_table -bind $bind_vars \ - unused $proc_query $top_proc_table_def]

    + unused $proc_query $top_proc_table_def]

    [ad_admin_footer]" Index: openacs-4/packages/monitoring/www/top/details.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/details.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/top/details.xql 19 Aug 2002 23:10:29 -0000 1.1 @@ -0,0 +1,27 @@ + + + + + + + + where timehour >= :start_time and timehour < :end_time + + + + + + + + select $load_and_memory_averages_sql, + count(*) as count, + $system_time_sql + from ad_monitoring_top $time_clause + and $details_clause + group by $system_group_by + [ad_order_by_from_sort_spec $orderbysystem $top_system_table_def] + + + + + Index: openacs-4/packages/monitoring/www/top/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/top/index-oracle.xql 19 Aug 2002 23:10:29 -0000 1.1 @@ -0,0 +1,69 @@ + + + + oracle8.1.6 + + + + + select to_char(sysdate,'HH24') from dual + + + + + + + + + (24 - (:end_time - :current_hour)) / 24 + + + + + + + + and (timestamp + :n_days $hour_correction) > sysdate + + + + + + + + select pid, command, username, + count(*) as count, + $hour_sql as timestamp, + round(avg(threads)) as threads, + round(avg(to_number(rtrim(cpu_pct, '%'))), 2) as cpu_pct + from ( select * from ad_monitoring_top $time_clause ) t, + ( select * from ad_monitoring_top_proc + where to_number(rtrim(cpu_pct, '%')) > :min_cpu_pct ) p + where p.top_id = t.top_id + group by pid, command, username, $hour_sql + [ad_order_by_from_sort_spec $orderby $top_proc_avg_table_def] + + + + + + + + round(nvl(avg(load_avg_1), 0), 2) as load_average, + round(nvl(avg(memory_free),0), -2) as memory_free_average, + round(nvl(avg(memory_swap_free), 0), -2) as memory_swap_free_average, + round(nvl(avg(memory_swap_in_use),0), -2) as memory_swap_in_use_average + + + + + + + + select round(max(timestamp) - min(timestamp) + 0.5) + from ad_monitoring_top $time_clause + + + + + + Index: openacs-4/packages/monitoring/www/top/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/top/index-postgresql.xql 19 Aug 2002 23:10:29 -0000 1.1 @@ -0,0 +1,68 @@ + + + + postgresql7.1 + + + + + select to_char(current_timestamp,'HH24') + + + + + + + + + (24 - (:end_time ::integer - $current_hour ::integer)) / 24 + + + + + + + + and (timestamp + :n_days ::integer $hour_correction) > current_timestamp + + + + + + + + select pid, command, username, + count(*) as count, + $hour_sql as timestamp, + round(avg(threads)) as threads, + round(avg(to_number(rtrim(cpu_pct, '%'), '9999D99')), 2) as cpu_pct + from ( select * from ad_monitoring_top $time_clause ) t, + ( select * from ad_monitoring_top_proc + where to_number(rtrim(cpu_pct, '%'), '9999D99') > :min_cpu_pct ) p + where p.top_id = t.top_id + group by pid, command, username, $hour_sql + [ad_order_by_from_sort_spec $orderby $top_proc_avg_table_def] + + + + + + + + round(coalesce(avg(load_avg_1), 0), 2) as load_average, + round(coalesce(avg(memory_free),0), -2) as memory_free_average, + round(coalesce(avg(memory_swap_free), 0), -2) as memory_swap_free_average, + round(coalesce(avg(memory_swap_in_use),0), -2) as memory_swap_in_use_average + + + + + + + + select max(timestamp) - min(timestamp) + '12 hours'::interval + from ad_monitoring_top $time_clause + + + + + Index: openacs-4/packages/monitoring/www/top/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/top/index.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/top/index.tcl 19 Aug 2002 23:10:29 -0000 1.2 @@ -3,7 +3,7 @@ ad_page_contract { Displays reports from saved top statistics. - @param n_days the # of days over which to average + @param n_days the number of days over which to average @param start_time taken between the given start @param end_time and end times on each day @param orderby the field by which to order the procedure-specific data @@ -13,7 +13,7 @@ @authors sklein@arsdigita.com, mbryzek@arsdigita.com @creation-date May 2000 - @cvs-id index.tcl,v 1.18.2.4 2000/08/02 19:04:34 kevin Exp + @cvs-id $Id$ } { {n_days 1} {start_time "00"} @@ -31,25 +31,25 @@ {timestamp "Hour" {} {}} {threads "Thr" {} {}} {command "Command" {} \ - {$command}} + {$command}} {username "Username" {} \ - {$username}} + {$username}} {pid "PID" {} \ - {$pid}} + {$pid}} {cpu_pct "CPU" {} {}} {count "Cnt" {} {}} } set top_system_avg_table_def { {day "date" {} \ - {$day}} + {$day}} {load_average "load" {} {}} {memory_free_average "free mem" {} \ - {[ad_monitor_format_kb $memory_free_average]}} + {[ad_monitor_format_kb $memory_free_average]}} {memory_swap_free_average "free swap" {} \ - {[ad_monitor_format_kb $memory_swap_free_average]}} + {[ad_monitor_format_kb $memory_swap_free_average]}} {memory_swap_in_use_average "used swap" {} \ - {[ad_monitor_format_kb $memory_swap_in_use_average]}} + {[ad_monitor_format_kb $memory_swap_in_use_average]}} {count "count" {} {}} } @@ -62,69 +62,45 @@ ## ## 1. Create the sql to filter by date and time -set time_clause "where timehour >= :start_time - and timehour < :end_time" - -if { [string compare $n_days "all"] != 0 } { +set time_clause [db_map time_clause_1] +if { ![string equal $n_days "all"] } { # Need to multiply n_days by ($end_time-to_char(sysdate,'HH24'))/24 to # get accurate current snapshots. That is, displaying back in time # needs to be relative to the selected end_time, not to sysdate. + + set current_hour [db_string mon_current_hour { *SQL* } ] - set current_hour [db_string mon_current_hour \ - "select to_char(sysdate,'HH24') from dual"] - if { $end_time > $current_hour } { - # we correct for the last day in the query if the end time - # is later than the current time. - set hour_correction " + (24 - (:end_time - :current_hour)) / 24 " + # we correct for the last day in the query if the end time + # is later than the current time. + set hour_correction [db_map hour_correction] } else { - set hour_correction "" + set hour_correction "" } - append time_clause " and (timestamp + :n_days $hour_correction) > sysdate" + append time_clause [db_map time_clause_2] } ### 2. Create the sql to fill top_proc_avg_table, grouping proc info ### by pid and averaging over each hour(day) that pid was running ### (default to hour). We need to be careful about avging over ### the whole time period b/c the same pid is eventually used by ### distinct processes. -set hour_sql "to_char(timestamp, 'MM/DD HH24') || ':00'" -set day_sql "to_char(timestamp, 'Mon DD')" +set hour_sql [db_map hour_sql] +set day_sql [db_map day_sql] ## -set avg_proc_query " - select pid, command, username, - count(*) as count, - $hour_sql as timestamp, - round(avg(threads)) as threads, - round(avg(to_number(rtrim(cpu_pct, '%'))), 2) as cpu_pct - from ( select * from ad_monitoring_top $time_clause ) t, - ( select * from ad_monitoring_top_proc - where to_number(rtrim(cpu_pct, '%')) > :min_cpu_pct ) p - where p.top_id = t.top_id - group by pid, command, username, $hour_sql - [ad_order_by_from_sort_spec $orderby $top_proc_avg_table_def] -" +# vinodk: FIXME below here 2002-08-17 +set avg_proc_query [db_map avg_proc_query] + # [ad_table_orderby_sql $top_proc_avg_table_def $orderby "DESC"] -set load_and_memory_averages_sql "round(nvl(avg(load_avg_1), 0), 2) as load_average, - round(nvl(avg(memory_free),0), -2) as memory_free_average, - round(nvl(avg(memory_swap_free), 0), -2) as memory_swap_free_average, - round(nvl(avg(memory_swap_in_use),0), -2) as memory_swap_in_use_average -" +set load_and_memory_averages_sql [db_map load_and_memory_averages_sql] ## the query to get system averages for each requested day. This is not ## the only query for display in an ad_table; note that "system" is tacked ## onto the end of the orderby variable [and elsewhere as regards this query]. -set avg_system_query " - select $load_and_memory_averages_sql, - count(*) as count, - $day_sql as day - from ad_monitoring_top - $time_clause - group by $day_sql - [ad_order_by_from_sort_spec $orderbysystem $top_system_avg_table_def] -" +set avg_system_query [db_map avg_system_query] + # [ad_table_orderby_sql $top_system_avg_table_def $orderbysystem "DESC"] ### Begin returning the page. @@ -145,22 +121,26 @@ set n_days_list [list] foreach n [list 1 2 3 7 14 31 all] { if { $n == $n_days } { - lappend n_days_list "$n" + lappend n_days_list "$n" } else { - lappend n_days_list "$n" + lappend n_days_list "$n" } } set start_select "" set end_select "" for { set i 0 } { $i < 25 } { incr i } { - if { $i == 0 | $i == 24 } { set text "Midnight" - } elseif { $i == 12 } { set text "Noon" - } elseif { $i > 12 } { set text "[expr {$i - 12}] pm" - } else { set text "$i am" - } + if { $i == 0 | $i == 24 } { + set text "Midnight" + } elseif { $i == 12 } { + set text "Noon" + } elseif { $i > 12 } { + set text "[expr {$i - 12}] pm" + } else { + set text "$i am" + } - append start_select "

     $errmsg 
    " - return + ad_return_error "top not found" " + The top procedure could not be found at $top_location: +
     $errmsg 
    " + return } - ad_return_error "insufficient top permissions" " - The top procedure at $top_location cannot be run: -
     $errmsg 
    " + ad_return_error "top could not be run" " + The top procedure at $top_location cannot be run: +
     $errmsg 
    " return } # top execution went ok @@ -230,7 +210,7 @@ } set number_rows [db_string mon_top_entries \ - "select count(*) from ad_monitoring_top $time_clause"] + "select count(*) from ad_monitoring_top $time_clause"] if { $number_rows == 0 } { append page_content " @@ -242,15 +222,13 @@ db_1row mon_top_load_and_memory_averages \ "select $load_and_memory_averages_sql from ad_monitoring_top $time_clause" - set num_days [db_string num_days_for_query \ - "select round(max(timestamp) - min(timestamp) + 0.5) - from ad_monitoring_top $time_clause"] + set num_days [db_string num_days_for_query { *SQL* } ] append page_content "

    Overall statistics

    • [util_commify_number $number_rows] - top measurement[util_decode $number_rows 1 "" "s"] on $num_days - distinct day[util_decode $num_days 1 "" "s"] satisfied your query
      + top measurement[ad_decode $number_rows 1 "" "s"] on $num_days + distinct day[ad_decode $num_days 1 "" "s"] satisfied your query
      (between [append start_time ":00"] and [append end_time ":00"] Hrs over the past $n_days days).
    • Average load: [format "%6.2f" $load_average]. @@ -269,11 +247,11 @@ append page_content " [ad_table -Tsuffix system -bind $bind_vars \ - mon_system_averages $avg_system_query $top_system_avg_table_def] + mon_system_averages $avg_system_query $top_system_avg_table_def]
      [ad_table -bind $bind_vars \ - mon_proc_averages $avg_proc_query $top_proc_avg_table_def] + mon_proc_averages $avg_proc_query $top_proc_avg_table_def]

      " Index: openacs-4/packages/monitoring/www/top/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/top/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/monitoring/www/top/index.xql 19 Aug 2002 23:10:29 -0000 1.1 @@ -0,0 +1,43 @@ + + + + + + + + where timehour >= :start_time and timehour < :end_time + + + + + + + + to_char(timestamp, 'MM/DD HH24') || ':00' + + + + + + + + to_char(timestamp, 'Mon DD') + + + + + + + + select $load_and_memory_averages_sql, + count(*) as count, + $day_sql as day + from ad_monitoring_top + $time_clause + group by $day_sql + [ad_order_by_from_sort_spec $orderbysystem $top_system_avg_table_def] + + + + + Index: openacs-4/packages/monitoring/www/watchdog/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/monitoring/www/watchdog/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/monitoring/www/watchdog/index.tcl 20 Apr 2001 20:51:11 -0000 1.1 +++ openacs-4/packages/monitoring/www/watchdog/index.tcl 19 Aug 2002 23:10:29 -0000 1.2 @@ -13,7 +13,7 @@ } else { set num_minutes "" if { ![info exists kbytes] || [empty_string_p $kbytes] } { - set kbytes 200 + set kbytes 200 } set bytes [expr $kbytes * 1000] } @@ -36,7 +36,7 @@

      -[ns_quotehtml [wd_errors "$num_minutes" "$bytes"]]
      +[ns_quotehtml [wd_errors -external_parser_p 1 -num_minutes "$num_minutes" -num_bytes "$bytes"]]
       
      [ad_admin_footer]