1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

I am a new to AIX need to write script

Discussion in 'Linux and Unix' started by nageshra, Apr 3, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. nageshra

    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
     
  2. lotuseclat79

    lotuseclat79

    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
     
  3. tomdkat

    tomdkat Retired Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,148
    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...
     
  4. lotuseclat79

    lotuseclat79

    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
     
  5. tomdkat

    tomdkat Retired Trusted Advisor

    Joined:
    May 6, 2006
    Messages:
    7,148
    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...
     
  6. Sponsor

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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/699856

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice