Highlighted
Honored Contributor.
Honored Contributor.
426 views

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

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

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

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

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

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

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

 

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

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

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

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

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"
😧
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 %DATE%, %TIME%
ECHO ************************
ECHO %DATE%,%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=

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

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

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%20report

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.