At devcon last year I presented a page that displayed all the active csp sessions and had a mechanism whereby I could set a session to immediately terminate - of course grace period still applied. Here is the page.

Suo Cong wrote:
Hi Peter,

If I want to monitor the active sessions I have to dump the information to a
text file and then load/analyze it?


"Peter Cooper" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Suo

this is not ideal - it sends it to a text file but here it is
do $System.License.DumpLocalAll()

peter

On Thu, 1 Apr 2004 13:58:40 +0200, "Suo Cong" <[EMAIL PROTECTED]>
wrote:


Dear all,

Is there a way to view how many sessions are currently active as well as
their IPs?

Thanks,
Suo






--
Bill McCormick
Web/Objects Support Manager
InterSystems Corporation
[EMAIL PROTECTED]

--------------000300020904000505080105
Content-Type: text/html;
name="Sessions.CSP"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Sessions.CSP"

<html>
<head>
<title> Sessions </title>
<link rel="stylesheet" href="isc.css" type="text/css">
</head>
<csp:class import="Webdev" INSERTBROKERAPPLET>
<body>
<csp:include page="Menu.csp">
<table>
<tr  id="thead">
<th><csp:text textid="ID" domain="webdev"></csp:text></th>
<th><csp:text textid="FN" domain="webdev"></csp:text></th>
<th><csp:text textid="LN" domain="webdev"></csp:text></th>
<th><csp:text textid="AT" domain="webdev"></csp:text></th>
<th><csp:text textid="connections" domain="webdev"></csp:text></th>
<th><csp:text textid="sess" domain="webdev"></csp:text></th>
<th><csp:text textid="logged" domain="webdev"></csp:text></th>
</tr>
<script language=cache runat=server>
set sub="",sessarray=0
kill lu
for  {
        set sub=$O(^%cspSession(sub))
        q:sub=""
        if sub'=0 {
                set sessarray=sessarray+1
                set ref=##class(%CSP.Session).%OpenId(sub,0)
                set id=ref.Get("Userid")
                if id'="" {
                        set emp=##class(Webdev.Employee).%OpenId(id)
                        set sessarray(id)=""
                        set sessarray(id,"FName")=emp.FName
                        set sessarray(id,"LName")=emp.LName
                        set sessarray(id,"AppTimeout")=ref.AppTimeout
                        set sessarray(id,"Sessions",ref.%Id(),"In")=ref.Get("Login")
                }
        }
 }
 set sub="",count=0
 for  {
          set sub=$O(sessarray(sub))
          q:sub=""
          set count=count+1
           if count#2 {
           set row="trowodd"
           }
          else {
                set row="troweven"
          }
          set lu=$SYSTEM.License.ConnectionCount(sub)
          &html<
          <tr id=#(row)#>
          <td id="tdata">#(sub)#</td>
          <td id="tdata">#(sessarray(sub,"FName"))#</td>
          <td id="tdata">#(sessarray(sub,"LName"))#</td>
          <td id="tdata">#(sessarray(sub,"AppTimeout"))#</td>
           <td id="tdata">#(lu)#</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          </tr>
          >
          set sess=""
          for {
                set sess=$O(sessarray(sub,"Sessions",sess))
                quit:sess=""
                set in=sessarray(sub,"Sessions",sess,"In")
                &html<
                <tr class="_row_">
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td id="tdata"><div id="#(sess)#" 
OnClick="SessionKill('#(sess)#');">#(sess)#</td><div>
                <td id="tdata">#($zt($P(in,",",2),4))#</td>
                </tr>
                </div>
                >
                }

 }
</script>
<tr><td id="tdata" colspan=4><csp:text textid="SessText1" domain="webdev"></csp:text>: 
#(sessarray)#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText2" domain="webdev"></csp:text>: 
#($SYSTEM.License.LUConsumed())#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText3" domain="webdev"></csp:text> : 
#($SYSTEM.License.LUMaxConsumed())#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText4" domain="webdev"></csp:text>: 
#($SYSTEM.License.LUAvailable())#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText5" domain="webdev"></csp:text>: 
#($SYSTEM.License.LUMinAvailable())#</td></tr>
</table>
<script language=javascript>
function SessionKill(sessionid) {
        var kill='';
        kill=#server(Webdev.Employee.KillSession(sessionid))#;
        if (kill) {
                alert('#(%response.GetText(%response.Language,"webdev","kill",""))#');
                self.document.location.reload()
        }
        else {
                CSPstartClock(1);
        }
}

</script>
<timer location="timedout.html" 
message=#(%response.GetText(%response.Language,"webdev","sesswarn","Time remaining before session 
timeout"))#>
</body>
</html>

--------------000300020904000505080105--



Reply via email to