Desktop productivity for business analysts and programmers

How to get IP Address of EG Client on SAS Server?

Accepted Solution Solved
Reply
Contributor
Posts: 67
Accepted Solution

How to get IP Address of EG Client on SAS Server?

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?


Accepted Solutions
Solution
‎05-30-2016 09:05 AM
Community Manager
Posts: 2,882

Re: How to get IP Address of EG Client on SAS Server?

[ Edited ]

@KurtBremser 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.

 

View solution in original post


All Replies
Super User
Posts: 7,371

Re: How to get IP Address of EG Client on SAS Server?

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 67

Re: How to get IP Address of EG Client on SAS Server?

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

Solution
‎05-30-2016 09:05 AM
Community Manager
Posts: 2,882

Re: How to get IP Address of EG Client on SAS Server?

[ Edited ]

@KurtBremser 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.

 

Super User
Posts: 7,371

Re: How to get IP Address of EG Client on SAS Server?


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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Community Manager
Posts: 2,882

Re: How to get IP Address of EG Client on SAS Server?

Ah, you're correct @KurtBremser! 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.

Contributor
Posts: 67

Re: How to get IP Address of EG Client on SAS Server?

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

Super User
Posts: 5,375

Re: How to get IP Address of EG Client on SAS Server?

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
Contributor
Posts: 67

Re: How to get IP Address of EG Client on SAS Server?

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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