Find number of connections to port 25 / port 80 in Solaris (Mail Administration/Web Administration)

March 29, 2011 | In: Iplanet, Solaris

You can use the “netstat” command in Solaris likewise in a Linux box. However, the syntax differs. Also, the output of netstat is different from that of Linux OS. Hence there is a slight difference in the pipe scripts used.


netstat -an -f inet | awk ‘$1 ~ /\.25$/’ | awk ‘{print $2}’ | cut -d ‘.’ -f1-4 | sort | uniq -c | sort -n

The above script is to find the number of connections to port 25, If you need to check the corresponding port, you can change it in the awk statement. To find the number of connections to port 80


netstat -an -f inet | awk ‘$1 ~ /\.80$/’ | awk ‘{print $2}’ | cut -d ‘.’ -f1-4 | sort | uniq -c | sort -n
mm
Hi All… I have been working the IT Industry since last ten years… Specialized in Linux, Cloud Infrastructure and Solution Design.
On the hobby friend, I do research on IOT, Micro-controllers, Electronics etc.
Music is my passion..Connect me on..

Comment Form

*

Authors

mm
Presoon John

Hi All... I have been working the IT Industry since last ten years... Specialized in Linux, Cloud Infrastructure and Solution Design.
On the hobby friend, I do research on IOT, Micro-controllers, Electronics etc.
Music is my passion..Connect me on..

Access this post via Mobile

Scan the QR Code
QR Code Generator

Categories