Operating System - HP-UX
1833788 Members
2513 Online
110063 Solutions
New Discussion

Re: system administration

 
Jayant Butte_1
New Member

system administration

Is there any way I can monitor ports in unix ?
I have a frontend server and a backend server. The application on the frontend uses certain ports to access the database on the backend server. I need to monitor these ports.
I have Patrol from BMC, with which I can monitor log files for a certain search string.
Can I write a script which generates a log file and this log file in turn is monitored by Patrol.
I tried using telnet, but did not succeed.
Please give some clue/help.

Thanks

Jayant
6 REPLIES 6
Bill McNAMARA_1
Honored Contributor

Re: system administration

try lsof and/or netstat -an

Later,
Bill
It works for me (tm)
Santosh Nair_1
Honored Contributor

Re: system administration

By monitor, do you mean you want (a) some sort of port sniffer, i.e. some program which sees all the traffic going through on that port, or are you just trying to see (b) which ports are in use and possibly (c) by which process.

If its (a), then you'd have to use something like snort (www.snort.org) or nettl (bundled with os). If its (b), then netstat -an|grep LISTEN. If its (c), then lsof -i.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Michael Tully
Honored Contributor

Re: system administration

Hi,

Have a look at ngrep and dsniff

www.openbsd.org/cgi-bin/cvsweb/ports/net/ngrep/
http://www.monkey.org/~dugsong/dsniff/

HTH
-Michael
Anyone for a Mutiny ?
Roger Baptiste
Honored Contributor

Re: system administration

Jayant,

If your intention is to just monitor
the status of the PORTs ,

netstat -a would be sufficient.

If you want to know what processes are
using the ports, you need to use the tool
"lsof " (free tool).

HTH
raj
Take it easy.
Uday_S_Ankolekar
Honored Contributor

Re: system administration

Hi,

Download lsof from hp porting centre website. It's a wonderfl tool to have.
This is the address
http://hpux.cs.utah.edu/hppd/

Goodluck

-USA..
Good Luck..
Rita C Workman
Honored Contributor

Re: system administration

lsof is good for checking on ports.
If you want to do more serious sniffing, Ethereal is free and a pretty power sniffer as well.

Just another option,
Rita

..here's the thread if you decide to try it, to help get it working...it's at the same porting site as above..
http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x56b9cf38d6bdd5118ff10090279cd0f9,00.html