Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ports listening on Solaris 10

Status
Not open for further replies.

Forum21

MIS
Sep 27, 2005
5
US
Hey Folks,

I'm trying to figure out what process or service is listening on this newly installed operating system on these ports:

*.8195 *.* 0 0 32768 0 LISTEN
*.8196 *.* 0 0 32768 0 LISTEN
*.8197 *.* 0 0 32768 0 LISTEN
*.8198 *.* 0 0 32768 0 LISTEN
*.8199 *.* 0 0 32768 0 LISTEN
*.8200 *.* 0 0 32768 0 LISTEN
*.8201 *.* 0 0 32768 0 LISTEN


Any ideas?
 
I've disabled everything in /etc/services except:

# awk '{print $1}' /etc/services | grep -v "#"
netstat
ssh
sunrpc
sunrpc
ldap
ldap
 
Code:
#!/bin/ksh

line='-------------------------------------------------------------------------'
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')


# Prompt users or use 1st cmdline argument
if [ $# -eq 0 ]; then
        read ans?"Enter port you like to know pid for:  "
else
        ans=$1
fi


# Check all pids for this port, then list that process
for f in $pids
do
        /usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
        if [ $? -eq 0 ] ; then
                echo $line
                echo "Port: $ans is being used by PID:\c"
                /usr/bin/ps -ef -o pid -o args | egrep -v "grep|pfiles" | grep $            f
        fi
done
exit 0
Run the above script on the ports in question to find the process.
 
Thanks for the script. Each time nothing is returned. What exe are you using to determine the process that's listening? pfiles?
 
If you could I would try to download lsof. Also check if your SMC is disabled or not, I think it uses port numbers in that range not positive though...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top