dbTalk Databases Forums  

Can Universe report my IP address?

comp.databases.pick comp.databases.pick


Discuss Can Universe report my IP address? in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ed Sheehan
 
Posts: n/a

Default Can Universe report my IP address? - 03-23-2011 , 08:28 AM






I have a Universe session (AIX), and need a program to write test data when
its IP address is one I specify in the code. SYSTEM(42) is NT only. Is there
a way to discover which IP address this program is running on inside the
program?

Thanks!

Ed

Reply With Quote
  #2  
Old   
Robert Joslyn
 
Posts: n/a

Default Re: Can Universe report my IP address? - 03-23-2011 , 09:26 AM






On Mar 23, 10:28*am, "Ed Sheehan" <NOedsS... (AT) xmission (DOT) com> wrote:
Quote:
I have a Universe session (AIX), and need a program to write test data when
its IP address is one I specify in the code. SYSTEM(42) is NT only. Is there
a way to discover which IP address this program is running on inside the
program?

Thanks!

Ed
Might try banging out and using a command line program with
capturing. I don't think IPCONFIG will give you what you want if you
are on a LAN with a router DHCP but there is surely a DOS Program that
will.
BobJ

Reply With Quote
  #3  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: Can Universe report my IP address? - 03-23-2011 , 10:33 AM



I believe you want the IP address of the connecting client, not the
server. Commands and data structures vary from one *nix platform to
the next so I can only provide generalities (unless I'm commissioned
for a solution).

On the connecting process, you may be able to parse the result of a SH
to "whoami" to get what you want. Try "who -m" to see if it's any
different. If the data has the IP address in parentheses, you can
parse it in BASIC, or use this as your shell command:

who -m | cut -f2 -d\( | cut -f1 -d\)

If that doesn't help, I believe that data is stored in utmp (directory
varies) and you might find a PHP, Perl, Java, or other utility that
reads/parses utmp data. You might need to first get the tty from some
command and then use that as a key to get the data you want from utmp.

Also note that doing this with SSH might be different than telnet.
SSH might load an environment variable with the client IP address.
Use "env" to see what's in there for your system.

That's all I got on me. A real answer would require real research,
sorry.

HTH
T

"Ed Sheehan" wrote:

Quote:
I have a Universe session (AIX), and need a program to write test data when
its IP address is one I specify in the code. SYSTEM(42) is NT only. Is there
a way to discover which IP address this program is running on inside the
program?

Thanks!

Ed

Reply With Quote
  #4  
Old   
sdavmor
 
Posts: n/a

Default Re: Can Universe report my IP address? - 03-23-2011 , 11:10 AM



On 03/23/2011 09:33 AM, Tony Gravagno wrote:
Quote:
I believe you want the IP address of the connecting client, not the
server. Commands and data structures vary from one *nix platform to
the next so I can only provide generalities (unless I'm commissioned
for a solution).

On the connecting process, you may be able to parse the result of a SH
to "whoami" to get what you want. Try "who -m" to see if it's any
different. If the data has the IP address in parentheses, you can
parse it in BASIC, or use this as your shell command:

who -m | cut -f2 -d\( | cut -f1 -d\)

If that doesn't help, I believe that data is stored in utmp (directory
varies) and you might find a PHP, Perl, Java, or other utility that
reads/parses utmp data. You might need to first get the tty from some
command and then use that as a key to get the data you want from utmp.

Also note that doing this with SSH might be different than telnet.
SSH might load an environment variable with the client IP address.
Use "env" to see what's in there for your system.

That's all I got on me. A real answer would require real research,
sorry.

HTH
T

"Ed Sheehan" wrote:

I have a Universe session (AIX), and need a program to write test data when
its IP address is one I specify in the code. SYSTEM(42) is NT only. Is there
a way to discover which IP address this program is running on inside the
program?

Thanks!

Ed
I think you're on the right track there Tony.
--
Cheers, SDM -- a 21st Century Schizoid Man
Systems Theory project website: http://systemstheory.net
find us on MySpace, GarageBand, Reverb Nation, Last FM, CDBaby
free MP3s of Systems Theory, Mike Dickson & Greg Amov music at
http://mikedickson.org.uk

Reply With Quote
  #5  
Old   
Ed Sheehan
 
Posts: n/a

Default Re: Can Universe report my IP address? - 03-23-2011 , 05:44 PM



Thanks T. I'll give these suggestions a try when I get in tomorrow.

Ed

"Tony Gravagno" <tony_gravagno (AT) nospam (DOT) invalid> wrote

Quote:
I believe you want the IP address of the connecting client, not the
server. Commands and data structures vary from one *nix platform to
the next so I can only provide generalities (unless I'm commissioned
for a solution).

On the connecting process, you may be able to parse the result of a SH
to "whoami" to get what you want. Try "who -m" to see if it's any
different. If the data has the IP address in parentheses, you can
parse it in BASIC, or use this as your shell command:

who -m | cut -f2 -d\( | cut -f1 -d\)

If that doesn't help, I believe that data is stored in utmp (directory
varies) and you might find a PHP, Perl, Java, or other utility that
reads/parses utmp data. You might need to first get the tty from some
command and then use that as a key to get the data you want from utmp.

Also note that doing this with SSH might be different than telnet.
SSH might load an environment variable with the client IP address.
Use "env" to see what's in there for your system.

That's all I got on me. A real answer would require real research,
sorry.

HTH
T

"Ed Sheehan" wrote:

I have a Universe session (AIX), and need a program to write test data
when
its IP address is one I specify in the code. SYSTEM(42) is NT only. Is
there
a way to discover which IP address this program is running on inside the
program?

Thanks!

Ed


Reply With Quote
  #6  
Old   
tpc
 
Posts: n/a

Default Re: Can Universe report my IP address? - 03-24-2011 , 03:23 AM



If you are running Accuterm, the ip address can be retrieved via
Accuterm programming using 'initsession.hostname'

Tom

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.