- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- TCP ports reports
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 05:19 AM
тАО04-04-2002 05:19 AM
TCP ports reports
I just want to regularly check with a shell script my open TCP ports.
How can I do that?
Regards for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 05:30 AM
тАО04-04-2002 05:30 AM
Re: TCP ports reports
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 05:32 AM
тАО04-04-2002 05:32 AM
Re: TCP ports reports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 05:35 AM
тАО04-04-2002 05:35 AM
Re: TCP ports reports
in shell script :
netstat -an | grep tcp | mailx -s "open tcp ports" youmailaddress
schedule the shell script to run from crontab.
If you have lsof installed, you can substitute
netstat with lsof -i tcp .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 05:39 AM
тАО04-04-2002 05:39 AM
Re: TCP ports reports
lsof is a good tool
else
#!/bin/ksh
netstat -an |head -n 2
netstat -an |tail -n +3|grep tcp
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 05:51 AM
тАО04-04-2002 05:51 AM
Re: TCP ports reports
code sniplet for KSH using lsof:
WHOAMI=$$
#
# "tr" is used to remove all extra spaces,
# TWO SPACES in first pair of quotes, ("bb" - where b = blank) then
# ONE SPACE in second pair of quotes ("b" - where b = blank)
#
WHATisSOCKET=`//usr/local/bin/lsof -U -a -p $WHOAMI|grep " 0t"|tr -s " " " "|cut -d"
" -f9`
echo $WHATisSOCKET
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-04-2002 06:05 AM
тАО04-04-2002 06:05 AM
Re: TCP ports reports
WHATisSOCKET=`/usr/local/bin/lsof -P -p $WHOAMI|grep -e " unix " -e " inet "|grep -e " TCP " -e " UDP "`
live free or die
harry