- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- MC Package Name
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
Forums
Discussions
Discussions
Discussions
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
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
09-23-2001 01:27 AM
09-23-2001 01:27 AM
Is it possible to know which user has loged in which package of MC/Service Guard ? Actually we have one cluster. 4 nodes is attached with that cluster. Now generally our user logs in by making telnet
Is their anyway to know package name where user has logged in ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2001 04:49 AM
09-23-2001 04:49 AM
Re: MC Package Name
One way that occured to me was to use the lsof command on the parent telnetd process, something like of -p $PPID|grep TCP. One of the field in this is the ip/hostname that established the telnet session.
I'm sure there are better ways, but this is what I came up with off the top off my head.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2001 06:40 AM
09-23-2001 06:40 AM
SolutionYou could do something like this,
Create a file called /etc/checkhost
/Begin/
#!/sbin/sh
trap "" 1 2 3
PATH=/usr/bin:/sbin:/usr/local/bin
UID=$(/usr/bin/id -u)
who -mu | awk '{print $2, $NF}' | while read TTY host
do
MYPID=`ps -ef |egrep " $PPID "|egrep -v "$$|egrep" | awk '{print $2}'`
TO_HOST=`lsof -p $MYPID | egrep ":telnet|:login" |head -1 | awk '{print $9}'|cut -d: -f1`
echo "##################################"
echo "You logged in to host $TO_HOST"
# You can do additional commands here based on the static or relocatable host
echo "########################"
sleep 4
done
/End/
Also modify your /etc/profile to include
/Begin/
if [ -f /etc/checkhost ]
then
. /etc/checkhost
fi
/End/
-HTH
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2001 07:18 AM
09-23-2001 07:18 AM
Re: MC Package Name
Get the hostname where the user came from using last -R -1 $LOGNAME. Then use netstat -a |grep
to get the IP address that they telneted to.
---snip---
FRM_HOST=$(last -R -1 snair|awk '{print $3}'|cut -f 1 -d.)
TO_HOST=$(netstat -a|grep $FRM_HOST|awk '{print $4'}|cut -f 1 -d.)
Code can probably be cleaned up a lot, but basically this is how it would work.
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2001 09:08 AM
09-23-2001 09:08 AM
Re: MC Package Name
If you have logging enabled for telnet in /etc/services , then i think you can find this info from /var/adm/syslog/syslog.log. Just a thought.
Hope this helps.
Thanks