Stigers, Greg [And] writes:
>
> Is there a good way to get BOTH IP address AND host name for sessions and
> socket users?
I can do that in one (long) line of shell script using Perl:
callci 'listfile /SYS/PUB/CI,8' | /PERL/PUB/PERL -p -e 'use Socket; s/REM : (.*)/"REM : $1 : ".gethostbyaddr(inet_aton($1),AF_INET)/e'
Which produces this output:
mbloaner:/SYS/CCCD$ ./accessors
********************
FILE: /SYS/PUB/CI
9 Accessors(O:9,P:9,L:0,W:0,R:9),Share
#S60 MARK,MANAGER.SYS P:1,L:0,W:1,R:1 REM : 159.115.2.2 : mbixby.dis.cccd.edu
#S58 MARK,MGR.BIND P:1,L:0,W:1,R:1 REM : 159.115.2.2 : mbixby.dis.cccd.edu
#S27 OPERATOR.SYS P:1,L:0,W:1,R:1 LDEV: 20
system MANAGER.SYS P:1,L:0,W:1,R:1 LDEV:
#J35 JHTTPD,WWW.APACHE P:1,L:0,W:1,R:1 SPID: #O1776
#J20 JNAMED,MGR.BIND P:1,L:0,W:1,R:1 SPID: #O1761
#J5 JDAEMON,SERVER.SENDMAIL P:1,L:0,W:1,R:1 SPID: #O1745
#J3 JSYSLOGD,MGR.SYSLOG P:1,L:0,W:1,R:1 SPID: #O1743
#J2 JINETD,MANAGER.SYS P:1,L:0,W:1,R:1 SPID: #O1742
Got Perl? :-) http://www.cccd.edu/~markb/perlix.html
PS: It should also be possible to do this (though much slower) by piping the
:LISTFILE output into awk and then calling /BIND/PUB/bin/nslookup to resolve
the addresses.
--
Mark Bixby E-mail: [log in to unmask]
Coast Community College Dist. Web: http://www.cccd.edu/~markb/
District Information Services 1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support Voice: +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)
|