- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Issue obtaining the users IP
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 01:40 AM
тАО10-08-2004 01:40 AM
/usr/bin/who -u | /usr/bin/grep `/usr/bin/who -m -R | /usr/bin/awk '{ print $2 }'`" " | /usr/bin/awk '{ print $8 }' | /usr/bin/nsl
ookup | /usr/bin/grep Address | /usr/bin/awk '{ print $2 }'
This script works great for anyone logged in on a normal terminal session. However, when called by a script from a web page via a cgi script I get the following response:
"process not attached to terminal"
I know it bombing at the "who -m". Problem is I can not figure out how to get around this issue.
Does any one have any idea how to obtain the IP address from a connection where the process is not attached to a terminal session?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 01:42 AM
тАО10-08-2004 01:42 AM
Re: Issue obtaining the users IP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 01:48 AM
тАО10-08-2004 01:48 AM
Re: Issue obtaining the users IP
So now that that is out of the way, any real suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 02:24 AM
тАО10-08-2004 02:24 AM
Re: Issue obtaining the users IP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 03:29 AM
тАО10-08-2004 03:29 AM
Re: Issue obtaining the users IP
The services entry specifies: UniHTTP 8080
Then in the inetd.conf file they have the following entry:
UniHTTP stream tcp nowait root /opt/acc/ud/bin/http.sh http.sh
http.sh then calls a 'C' routine that lanches an application within their database environment.
So the actual deamon performing the call is inetd. Is there anyway of extracting the IP from inetd or getting inetd to append the IP to the shell call as a parameter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 04:59 AM
тАО10-08-2004 04:59 AM
Re: Issue obtaining the users IP
UniHTTP stream tcp nowait root /opt/acc/ud/bin/http.sh http.sh
You can send parameter to that script as,
UniHTTP stream tcp nowait root /opt/acc/ud/bin/http.sh http.sh `shell action to get ip there and send it there`
And your try as,
/usr/bin/who -u | /usr/bin/grep `/usr/bin/who -m -R | /usr/bin/awk '{ print $2 }'`" " | /usr/bin/awk '{ print $8 }' | /usr/bin/nsl
ookup | /usr/bin/grep Address | /usr/bin/awk '{ print $2 }'
seems to be very strange there.
you can use getip command here.
getip
So you can get the remote ip-address as,
getip `who -mR | awk '{ print $6 }' | tr -d '()'`
It will give the IP-Address there easily.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-08-2004 05:57 AM
тАО10-08-2004 05:57 AM
Re: Issue obtaining the users IP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2004 11:50 PM
тАО10-12-2004 11:50 PM
Re: Issue obtaining the users IP
can you verify step by step as,
1. IP=$(who -mR | awk '{ print $6 }' | tr -d '()')
2. getip $IP
Try to execute with full path of getip , who there. You can that with which getip / which who there. Post your problem with your try again.
Regards,
Muthukumar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 01:08 AM
тАО10-13-2004 01:08 AM
Re: Issue obtaining the users IP
IP=$(who -mu | awk '{print $NF}'
The answer is that your process is not attached to a terminal. Just like cron or at, inetd has no terminal and therefore an IP address is meaningless. You'll have to extract the adress for the web page from your web server as who does not understand web pages (no Unix login).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2004 01:15 AM
тАО10-13-2004 01:15 AM
Re: Issue obtaining the users IP
inetd is passing the statement to the target program as a parameter, without evaluating the statement first.
As a result the target script will see $x value as follows:
$1 = `who
$2 = -mR
$3 = |
$4 = awk
etc...