BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
saxenp08
Fluorite | Level 6

Hello,

Could someone help me extract SASApp - Workspace Server information in an output dataset/file?

I have already tried PROC IOMOPERATE with sasadm@saspw connection profile. Blog: PROC IOMOPERATE

 

It gives information for all the active PIDs and users in a dataset (Information is available in SAS MC).

saxenp08_1-1669790931079.png

What I need further is - when clicking on an active PID, the "Properties" information of the specific user, which is available under the Clients tab (need "Hostname" to be specific). The HostName, available from PROC IOMOPERATE, differs from the Host Name present under the Properties (The Properties Host Name tells about the remote desktop information). I need this information to create a stored process which will capture information for all the active PIDs, and active users and then from which machine the user is connected to.

 

saxenp08_6-1669791736814.png


Thank you in advance!

Best Regards

1 ACCEPTED SOLUTION

Accepted Solutions
PaulHomes
Rhodochrosite | Level 12

You wouldn't normally be able to find this type of dynamic run-time information in metadata but it is available from PROC IOMOPERATE using the list clients features - see https://support.sas.com/documentation/cdl/en/biasag/62612/HTML/default/viewer.htm#n20033intelplatfor...

 

I took the sample code by @ChrisHemedinger in his blog post linked above and tweaked it to add an allclients table that contains the 3x columns provided by list clients: client (userid), peer (workstation IP address and port) and entertime.

 

I posted the sample code in a gist at https://gist.github.com/paulhomes/029f77032e809e2a1d8ee7a13fc52c14

View solution in original post

10 REPLIES 10
saxenp08
Fluorite | Level 6
Hello, and thank you for your reply.

The solutions you have suggested I have already tried (also suggested in my query). The problem is I need to capture the VDI info, which I have shared via screenshot. All the other information is available using the proc iomoperate, but only information is missing which I must extract.
andreas_lds
Jade | Level 19

I don't know any way to extract the information using code. While using the old "metabrowse" in the display manager (classic sas programming tool) i wasn't able to find anything useful.

 

Maybe @PaulHomes or @MichelleHomes have an idea.

PaulHomes
Rhodochrosite | Level 12

You wouldn't normally be able to find this type of dynamic run-time information in metadata but it is available from PROC IOMOPERATE using the list clients features - see https://support.sas.com/documentation/cdl/en/biasag/62612/HTML/default/viewer.htm#n20033intelplatfor...

 

I took the sample code by @ChrisHemedinger in his blog post linked above and tweaked it to add an allclients table that contains the 3x columns provided by list clients: client (userid), peer (workstation IP address and port) and entertime.

 

I posted the sample code in a gist at https://gist.github.com/paulhomes/029f77032e809e2a1d8ee7a13fc52c14

PaulHomes
Rhodochrosite | Level 12

In my case I got back client IP addresses so if you want DNS names then maybe loop over them and do a dig or nslookup command on the IP address to get a hostname if available. I can't tell from your screenshot whether you were seeing IP addresses or hostnames in SAS Management Console - I see IP addresses in mine - exactly what I see in the ALLCLIENTS table.  I would use a command like "dig +short -x 10.1.2.3" to get a hostname for the 10.1.2.3 IP address.

saxenp08
Fluorite | Level 6
Thank you very much for this. I will give it a try.

By the way, for me, it is not the IP address under "Hostname", though. It has the information of the remote desktop (VDI) linked to that specific process id. I will try the solution you've suggested and provide an update.
saxenp08
Fluorite | Level 6

Hello,

Sorry for the late update.

The solution with the list allclient works as it gives me the relevant IP address. But there is a minor issue.

It captures information for all clients but misses one client every time. The message I received in the log file is as follows:

NOTE: The LIST ATTRIBUTES command completed.
NOTE: Compression was disabled for data set WORK.CLIENTSxxx because compression overhead would increase the size of the data set.
NOTE: The data set WORK.CLIENTSxxx has 0 observations and 3 variables.

NOTE: The LIST CLIENTS command completed.

So because of this null dataset, if the active sessions from the "list attrs" is n then I am getting n-1 results from list clients.

I am working to find out why this is happening, but if you have any idea, can you please help?

Thank you!

PaulHomes
Rhodochrosite | Level 12

An empty clients table means that server has no clients at that time. Typically this would be a server that might live for a while after the last client disconnects. You will get this for things like the SAS Stored Process Server and SAS Pooled Workspace Server. I just replicated your scenario by having a single active workspace server session and validating the SAS Stored Process server in SAS Management Console (to ensure a server process was started). My PIDs table had 2 rows for the 2 servers (workspace and stored process) and the clients table had only 1 row for the currently connected workspace server client - the stored process server had no clients.

 

I suspect you are seeing something similar.

 

saxenp08
Fluorite | Level 6

Hello again,

finally, I was able to test the completed solution.

The generated report uses "allclients" and tells the information up to the "clients" level.

For Host DNS under the "client properties" level, using "dig +short -x IP" works to get a hostname for the active IP address.

Thank you very much for all the help also addressing my other doubt regarding missing entries.

PaulHomes
Rhodochrosite | Level 12
It's great to hear you have it all working now. Thanks for reporting back and marking it as solved.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 2809 views
  • 6 likes
  • 4 in conversation