How to check the list of current users logged in SM.

Hi Experts,

 

My requirement is to the check list of user's currently logged in Service Manager without using system status.

 

Is there any way to check it?

 

Any Suggestions are appreciated.

 

Thanks & Regards,

Sandhu Mol

  • If you have access to the SM server, you can run sm -reportlic:1.

  • Thank you for your replay.

    Actually we need to automate and save te results somehere to create some charts based on it.

    Is there any way to do it ?

    Thanks & Regards,

    Sandhu mol

     

  • Hi,

    system status is using the RAD function processes(). Maybe you can use it and parse the results from this function.

    https://s3.amazonaws.com/smhelpcenter/smhelp941/classic/index.html#programming/system_language/reference/rad_function_processes.htm?TocPath=Guides%20and%20reference|Programming%20Guide|System%20Language%20reference|List%3A%20RAD%20functions|_____81

     

  • I have done something like this for license counts.

    On the service manager application server (windows) server I have a .bat file that reads and parses the command sm -reportlic (You could do this with sm -reportlic:1).  It puts the results into a txt file.  Then I set up a Windows Task on on the server to run the bat file every 5 minutes.  

    We do this to make sure that we have enough licenses and see when the heavy usage times are.

    I've added the contents of the file below. It would be saved as a .bat file.  I named mine CountSMSessions.bat. You could use this as a starting point and change it as needed to look at sm -reportlic:1 instead of just sm -reportlic

    ====

    @ECHO OFF
    SET TempFile="D:\Program Files (x86)\HP\Service Manager 9.50\RUN\reporting\TempFile.txt"
    SET TempFile2="D:\Program Files (x86)\HP\Service Manager 9.50\RUN\reporting\TempFile2.txt"
    D:
    CD "D:\Program Files (x86)\HP\Service Manager 9.50\RUN"
    sm.exe -reportlic > %TempFile%
    find /I "Login License" %TempFile%  > %TempFile2%
    ::Simplified Stat File containing info
    SET StatFile=D:\Program Files (x86)\HP\Service Manager 9.50\RUN\reporting\statfile.csv
    If EXIST "%StatFile%" for %%S in ("%StatFile%") do SET StatFileSize=%%~zR
    IF NOT EXIST "%StatFile%" Set StatFileSize=0
    If %StatFileSize% GTR %LogFileRollAt% copy "%StatFile%" "%StatFile%.1"
    If %StatFileSize% GTR %LogFileRollAt% del "%StatFile%"
    GOTO LICCOUNT
    :LICCOUNT
    FOR /F "usebackq tokens=3 delims=( " %%i in (%TempFile2%) DO SET NAMED=%%i
    FOR /F "usebackq tokens=5 delims=( " %%i in (%TempFile2%) DO SET FLOAT=%%i
    GOTO CALCULATE
    :Calculate
    SET NAMED=%NAMED:(=%
    SET FLOAT=%FLOAT:(=%
    SET /A TOTAL= %NAMED% %FLOAT%
    ECHO ************************
    ECHO Named = %NAMED%
    ECHO Floating = %FLOAT%
    ECHO Total = %TOTAL%
    ECHO �TE%, %TIME%
    ECHO ************************
    ECHO �TE%,%TIME%,%NAMED%,%FLOAT%,%TOTAL% >> "%StatFile%"
    GOTO END
    :End
    ::Clean up variables
    SET TempFile=
    SET TempFile2=
    SET StatFile=
    SET StatFileSize=
    SET NAMED=
    SET FLOAT=
    SET TOTAL=

     

  • If you have set up Reporting for SM, you could use these 3 out of the box licensing reports (with vertical bar chart). See https://docs.microfocus.com/SM/9.52/Codeless/Content/reporting/reference/report_des_usage.htm?Highlight=license report

    Note: As this is based on a copy of production db, there's no reporting impact on production environment.