Skip navigation
All Places > CA Service Management > Blog > 2016 > January > 04

I was looking for the method to get information about all current sessions in SDM. As I understand bop-login is the process responsible for handling of the sessions. From trigger definition in ldap.maj i have learned that it is possible to execute methods defined there. Examination of boplgn.exe revealed that there is a number of other methods defined there, and one of them is called session_info that returns a lot of interesting information like:

count of active sessions, session id's, userid, current user role and etc.

 

Here is an example of the code that you can use to execute using bop_cmd

 

void login2()
{
int i,j,count;
send_wait(0, (object)("@|BOP-LOGIN|validate_user|0"), "session_info");
   if (msg_error()) { 
    printf("Error %s",msg[0]);
   }
   else{
    j=0;
    count = msg[0];

    printf("Sessions found: %s \n",count);
    for(i=0;i<count;i++){
    j=i*12+1;

    printf("======= %s ==============\n", msg[j+3]);
    printf("Session ID: %s \n", msg[j]);
    printf("Webengine: %s \n", msg[j+1]);
    printf("Domsrv: %s \n", msg[j+2]);
    printf("Userid: %s \n", msg[j+3]);
    printf("User persistent_id: %s \n", msg[j+4]);
    printf("Current user role: %s \n", msg[j+5]);
    printf("Licensed? %s \n", msg[j+6]);
    printf("Session type: %s \n", msg[j+7]);
    //All session types canS be found in session_type object here are some of them
    //"Web browser session" ,"1"
    //"SOAP Web services session" ,"3"
    //"Server utility session" ,"4"
    //"REST Web Services Session" ,"10"
    printf("Web Service login policy: %s \n", msg[j+8]);
    printf("Session status: %s \n", msg[j+9]);//4 - incative 2 - active 3-timed-out
    printf("Login time stamp: %s \n", msg[j+10]);
    printf("Logout time stamp: %s \n", msg[j+11]);
    printf("\n\n\n");
    }

   }
}

And here is batch file content to execute it

bop_cmd -u ServiceDesk -f %~dp0/log.frg login2("")

 

 

 

I also have plans to explore bop_login methods further. If someone have any info on this topic please share.

Dear SM Community Members,

 

Welcome to the New Year!

 

It's great that we have such a vibrant community to get quick answers to questions and gain product knowledge! We have very active members jumping in to help others out all the time. The goal of the community is to respond to every members' question so that no one goes away "empty handed". To help further responses to all questions we have the following campaign.

 

                     

Jump In! Help a Fellow Community Member Out!

 

Here's the list of unanswered questions for this coming week:

Using PRESET to set property values

Hide inactive notification history entry

How to terminate action via spel macro without displaying error?

BSI - Metric calculating average of other metric results

How to create average time report on query object

How to add "Service Type name" into Incident list (SDM 12.9)?

Restrict Service Folder Access in Service Catalog

 

Thank You All for Your Efforts!

Chris