Index: openacs-4/packages/acs-admin/www/cluster.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/cluster.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-admin/www/cluster.tcl 8 Feb 2023 18:35:05 -0000 1.1.2.1 +++ openacs-4/packages/acs-admin/www/cluster.tcl 4 Dec 2023 15:32:58 -0000 1.1.2.2 @@ -52,7 +52,19 @@ set all_cluster_hosts [server_cluster_all_hosts] set active_peer_nodes [lsort [nsv_get cluster cluster_peer_nodes]] + #ns_log notice "all_cluster_hosts <$all_cluster_hosts> active_peer_nodes <$active_peer_nodes>" set elements_list { + state { + label "State" + html {align center} + display_template { + + +   + + } + } + node_name { label "Node" orderby node_name @@ -106,7 +118,7 @@ } } - multirow create cluster_nodes node_name current_p \ + multirow create cluster_nodes state node_name current_p \ canonical_p dynamic_p peer_p \ last_contact pretty_last_contact \ last_request pretty_last_request \ @@ -131,8 +143,21 @@ } } } + if {$last_contact eq ""} { + set state self + } else { + set timeunit [parameter::get \ + -package_id $::acs::kernel_id \ + -parameter ClusterHeartbeatInterval \ + -default 20s ] + set state [expr {[clock seconds]-($last_contact/1000) > [ns_baseunit -time $timeunit] + ? "inactive" + : "active" + }] + } - multirow append cluster_nodes $node \ + multirow append cluster_nodes \ + $state $node \ [expr {$node eq $current_node}] \ [acs::cluster is_canonical_server $node] \ [expr {$node in $dynamic_cluster_nodes}] \