Index: openacs-4/packages/acs-admin/lib/site-wide-services.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/lib/site-wide-services.adp,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/acs-admin/lib/site-wide-services.adp 18 Sep 2003 21:02:30 -0000 1.6
+++ openacs-4/packages/acs-admin/lib/site-wide-services.adp 24 Oct 2003 15:25:19 -0000 1.7
@@ -6,5 +6,6 @@
Authentication
Documentation
+ Active connections
Index: openacs-4/packages/acs-admin/www/monitor.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/monitor.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-admin/www/monitor.adp 24 Oct 2003 15:25:19 -0000 1.1
@@ -0,0 +1,21 @@
+
+ @page_title;noquote@
+ @context;noquote@
+
+
+ There are a total of @connections:rowcount@ requests being served
+ right now (to @distinct@ distinct IP addresses). Note that this number
+ seems to include only the larger requests. Smaller requests, e.g.,
+ for .html files and in-line images, seem to come and go too fast for
+ this program to catch.
+
+
+
+ Here's what uptime has to say about the box:
+
+@uptime_output@
+
+Connections
+
+
+
Index: openacs-4/packages/acs-admin/www/monitor.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/monitor.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-admin/www/monitor.tcl 24 Oct 2003 15:25:19 -0000 1.1
@@ -0,0 +1,62 @@
+ad_page_contract {
+ Show list of active connections, plus uptime status about the box.
+}
+
+set page_title "Active Connections"
+set context [list $page_title]
+
+set connections [ns_server active]
+
+array set ip_p [list]
+
+multirow create connections num ip state method url seconds bytes
+
+foreach connection $connections {
+ multirow append connections \
+ [lindex $connection 0] \
+ [lindex $connection 1] \
+ [lindex $connection 2] \
+ [lindex $connection 3] \
+ [lindex $connection 4] \
+ [lindex $connection 5] \
+ [lindex $connection 6]
+
+ set ip_p([lindex $connection 1]) 1
+}
+
+template::list::create \
+ -name connections \
+ -multirow connections \
+ -elements {
+ num {
+ label "Conn\#"
+ }
+ ip {
+ label "IP"
+ }
+ state {
+ label "State"
+ }
+ method {
+ label "Method"
+ }
+ url {
+ label "URL"
+ }
+ seconds {
+ label "\# Seconds"
+ }
+ bytes {
+ label "Bytes"
+ }
+ }
+
+set distinct [llength [array names ip_p]]
+
+# run standard Unix uptime command to get load average (crude measure of
+# system health)
+
+if [catch { set uptime_output [exec /usr/bin/uptime] } errmsg] {
+ # whoops something wrong with uptime (check path)
+ set uptime_output "ERROR running uptime, check path in script"
+}