Question How to get appserver name for code running on an appserver agent

GregTomkins

Active Member
Well ... you could find your PID from VST's, and then grep your log file directory for the one that contains references to that PID. That would be pretty nasty, obviously!

You could try looking around VST's more to see if there is anything to help you, but I kind of doubt it.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
A client (including an agent) can get its userid and PID from _MyConnection. But I don't think VSTs will help. The DB doesn't know what name you've given to the application service that the agent implements.

I believe there are some AppServer-specific methods and properties on the Session system handle. Maybe one of those will help.
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
I believe _MyConnection *is* a VST.
Yes, it is. :)

I meant that other than getting the PID and using your earlier suggestion of grepping the logs, the VSTs won't help. In other words, there isn't a VST that contains records for all the registered application services.
 

Carl Pyckhout

New Member
So,
It seems I could use a combination of looking up the PID by the _MyConnection, and grepping in the log file, but this seems a rather clumsy way to get to that information.
I looked at all methods and properties for the Session system handle, but also that does not seem to include anything I can use.

Thanks a lot for the info so far.
 

TheMadDBA

Active Member
An alternative is to pass that information to
Code:
SESSION:PARAMETER
via the -param startup. Or you can set up a super procedure via the startup/connect procedures depending on what state mode you are running.
 

Cringer

ProgressTalk.com Moderator
Staff member
Assume you're using Linux as you're grepping stuff? Why not create a simlink for _proapsrv to the name of your AppServer, then modify the lauch procedure to be the name of your AppServer. That way all your AppServer agents will be running against a process that is called the name of your AppServer. Then you can grep in ps -ef for your PID, and pull out the process name, bingo - there's your AppServer name.
Hope that makes sense.
 

Carl Pyckhout

New Member
Assume you're using Linux as you're grepping stuff? Why not create a simlink for _proapsrv to the name of your AppServer, then modify the lauch procedure to be the name of your AppServer. That way all your AppServer agents will be running against a process that is called the name of your AppServer. Then you can grep in ps -ef for your PID, and pull out the process name, bingo - there's your AppServer name.
Hope that makes sense.
This is indeed also a possible approach, but it would require us to take action every time we upgrade the progress version.
 

TomBascom

Curmudgeon
Upgrading is in itself an action. If you are already in motion it is easy enough to add another small step to your process.
 
Top