How I can monitor outbound connection that are made from my server along with the program/application which has made the connection request? I have tried using the below command and I am not much familiar with it so not sure if the output is all outbound connections:

netstat -nputw | awk '{if (!match($4, /:443/)&&!match($4, /:80/)&&!match($4, /:82/)&&!match($4, /:8080/)&&!match($4, /:22/)) print $0}'

Here 443,82,22,80 are my server listener port.

New contributor
cricket viewr is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

nethogs is an excellent top command like tool, but showing network activity grouped by processes. Should help you quite a lot especially if your server does not have tons of activity.

  • I tried with this command. Do want to add anything? # netstat -nputw | awk '{if (!match($4, /:443/)&&!match($4, /:80/)&&!match($4, /:82/)&&!match($4, /:8080/)&&!match($4, /:22/)) print $0}' (Here 443,82,22,80 are my server listener port) – cricket viewr Jan 10 at 9:01
  • netstat -naputw | awk '{if (!match($4, /:443/)&&!match($4, /:80/)&&!match($4, /:82/)&&!match($4, /:8080/)&&!match($4, /:22/)&&!match($5, /!match($5, /(192|10|172).([0-9]+).([0-9]+).([0-9]+)((:[0-9]+)*)/)) print $0}' – cricket viewr Jan 10 at 11:34

Your Answer

cricket viewr is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.