I am a new to AIX need to write script

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

nageshra

Thread Starter
Joined
Apr 3, 2008
Messages
1
hi,

I want to write a script to know the status of the process like status of the listener port for Appliction server running in WAS.Plesae help me

Nagesh Rao
 
Joined
Sep 12, 2003
Messages
20,583
Hi nageshra,

Welcome to TSG!

Assuming you already know how to write a script, here is a list of example commands you should read the man pages for and potentially use in writing your script:

Listening open ports:

# netstat -an | grep LISTEN
# lsof -i # Linux list all Internet connections
# socklist # Linux display list of open sockets
# sockstat -4 # FreeBSD application listing
# netstat -anp --udp --tcp | grep LISTEN # Linux
# netstat -tup # List active connections to/from system (Linux)
# netstat -tupl # List listening ports from system (Linux)
# netstat -ano # Windows

-- Tom
 

tomdkat

Retired Trusted Advisor
Joined
May 6, 2006
Messages
7,148
hi,

I want to write a script to know the status of the process like status of the listener port for Appliction server running in WAS.Plesae help me

Nagesh Rao
What kinds of status information of a process are you looking to retrieve? The commands posted above will provide status on sockets and port states but won't identify which actual process is associated with any given socket connection. For example, the "netstat -a" command will display info on which ports are active and which state they are in as well as socket connections. That command will not identify which process is communicating or is associated with any port or socket listed in the netstat output.

Of course, you can use "ps" to find out which processes are running but I'm wondering if you're looking for a way to ascertain that process with PID nnn is running and listening on port xxx, for example.

Peace...
 
Joined
Sep 12, 2003
Messages
20,583
Hi tomdkat,

socklist will associate ports, inodes, pids, uid and executable names with connection type. It may not be installed, however, as it wasn't on my Ubuntu Linux (7.10) Gutsy Gibbon, so, I refreshed my repositories with: $ sudo apt-get update, and then used Synaptic Package Manager to install procinfo which included socklist.

I do not know if a similar tool exists on AIX, however.

-- Tom
 

tomdkat

Retired Trusted Advisor
Joined
May 6, 2006
Messages
7,148
I do not know if a similar tool exists on AIX, however.
I don't think there is, but I'm also not sure. One thing I just learned about socklist is it's a Perl script, not a native Linux binary, so that script might work (maybe with some adjustment) on AIX or other Unix systems.

Peace...
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top