BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Slash
Quartz | Level 8

Hi, all

       I want to record the information of EG user who logging on SAS Server, including the logging datetime, sas user name, client machine's name, client machine's IP address. So my solution is add code in the file: "C:\SAS\EMiner\Lev1\SASApp\appserver_autoexec_usermods.sas" on the server machine.

And I can get the sas user name from macro varialbe "SYSUSERID", client machine's name from macro variable "_CLIENTMACHINE", but I can't get the IP Address. Where should I can get the IP Address?

 

And another problem, I also want to record the log off time, so when the EG user close the EG or disconnect the SASApp server, how can I know? Where I can write the sas code to record the log off information on the server machine?

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

@Kurt_Bremser answered the first part of your question and provided good clues about the second part.  For the second part you might be looking for the equivilent of the TERMSTMT option -- but there isn't one.  However, there are cues in the ObjectSpawner log, ex:

 

Client connection 11 for user sassrv@l77841 closed.

 

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

View solution in original post

8 REPLIES 8
Kurt_Bremser
Super User

You can find these informations in the ObjectSpawner log.

Logon creates messages of the type

"New client connection (number) accepted from server port serverport for user user. .....  Peer IP address and port are [::ffff:ip_address_v4]:clientport."

"Created process processnumber for user user (child id childid)."

Termination creates a message

"Process processnumber for user user (child id childid) has ended."

All messages start with a timestamp, user, processnumber and childid can be used to connect start and termination of sessions.

Slash
Quartz | Level 8

Thankyou very much. Sorry I can only select one solution for my post.Smiley Sad

It seems it's the only way can get IP Address, from the ObjectSpawner log:

 

QQ图片20160530213230.png

ChrisHemedinger
Community Manager

@Kurt_Bremser answered the first part of your question and provided good clues about the second part.  For the second part you might be looking for the equivilent of the TERMSTMT option -- but there isn't one.  However, there are cues in the ObjectSpawner log, ex:

 

Client connection 11 for user sassrv@l77841 closed.

 

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Kurt_Bremser
Super User

@ChrisHemedinger wrote:

...

 

Client connection 11 for user sassrv@l77841 closed.

 


Caution, Chris: that message comes immediately after the Workspace Server session has been started, but it does not denote it's end. That comes later in the form I mentioned.

So this message is not suited to register the end of someone's workspace server activity.

ChrisHemedinger
Community Manager

Ah, you're correct @Kurt_Bremser! The ObjectSpawner's job is to authenticate and launch the sas.exe/shell script, then hand the connection over to the Workspace Server.  Then get out of the way.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Slash
Quartz | Level 8

Thanks, Chris, you always solve my problem! Smiley Very Happy

I really should invite you for dinner.

 

 

The TERMSTMT option does work. I run a little test.

Add this option in "C:\SAS\EMiner\Lev1\SASApp\sasv9.cfg" configuration file:

 

Catch.jpg

 

I trace the WorkspaceServer log, and it did executed.

 

Catch4734.jpg

 

And the file is created:

Catch4AF0.jpg

LinusH
Tourmaline | Level 20

just for clarification.

When you say "logging on/off" - to me that's not at all equivalent when there are workspace server sessions active.

The logon/logoff events are better captured in the metadata sever log.

 

And before you are digging into deep with hand written parsing, take a look of what you can get from Environment Manager, and rather extend the capabilities there.

Data never sleeps
Slash
Quartz | Level 8

Because I'm still using 9.3 version, there is no Environemnt Manager, so I must done it by myself.Smiley Wink

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 5576 views
  • 5 likes
  • 4 in conversation