- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Determining inbound IP address used
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
тАО08-24-2006 05:57 AM
тАО08-24-2006 05:57 AM
Determining inbound IP address used
Specifically, this functionality is used to determine if the user was telnetting to the host IP address or the MC/SG package address. Profile / startup script processing is then conditioned based on the IP address used.
We recently upgraded our test cluster to UX 11.23 and found out that the method of handling telnet sessions has changed such that lsof can no longer retrieve the inbound address used. After speaking with HP support, it looks like our only alternative is to utilize a crash dump/debugger utility which will add a significant layer of complexity.
Does anyone else have a non-lsof solution which may work for this UX release?
Thanks!
Scott Stewart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 06:51 AM
тАО08-24-2006 06:51 AM
Re: Determining inbound IP address used
Give these cobbled-together commands a shot...
For hostname:
# who -R | tr -s ' ' '\n' | grep '(.*)' | tr -d '()'
# last -R -1 | awk -F'[\. ]+' '{print $3}'
For IP:
# who -R | tr -s ' ' '\n' | grep '(.*)' | tr -d '()' | nslookup | grep 'Address' | awk '{print $2}'
# last -R -1 | awk -F'[\. ]+' '{print $3}' | nslookup | grep 'Address' | awk '{print $2}'
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 06:55 AM
тАО08-24-2006 06:55 AM
Re: Determining inbound IP address used
I agree that the last -R command should give you exactly what you need. You won't pull the information in like lsof, but you should be able to get exactly what you need.
Its important to prevent the /var/adm/wtmp file from getting corrupted or you will get inaccurate information.
I would also note that if you can avoid it, you should stop using telnet. It authenticates in clear text and there are plenty of free openssh/ssh clients you can use to replace communications between machines or between cluster and clients.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 07:05 AM
тАО08-24-2006 07:05 AM
Re: Determining inbound IP address used
# who -mR | ...
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 12:51 PM
тАО08-24-2006 12:51 PM
Re: Determining inbound IP address used
That is, of course, if who -R doesn't work:
# who -R
root console Jun 16 14:14 (tarry.hpl.hp.com)
root pts/ta Aug 24 17:49 (tardy.cup.hp.com)
# uname -a
HP-UX tarry B.11.23 U ia64 2397028692 unlimited-user license
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 02:32 PM
тАО08-24-2006 02:32 PM
Re: Determining inbound IP address used
If I understand correctly, he is NOT asking what IP address the connection is FROM, rather he is asking what IP address the user is connecting TO.
For example, is the user doing a:
telnet 1.2.3.4
or
telnet 3.4.5.6
I do something similar, but I use lsof on 11.11, as you used to Scott. Apparently that connection information is not kept on 11.23.
I've tried netstat and lsof and not had any luck getting the info on 11.23.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-24-2006 02:58 PM
тАО08-24-2006 02:58 PM
Re: Determining inbound IP address used
If that's the case, I recommend writing a wrapper script around the 'telnet' binary which logs the destination ip to a central location.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-25-2006 05:02 AM
тАО08-25-2006 05:02 AM