Skip to content

Display network connectivity information as json for all process and threads

Notifications You must be signed in to change notification settings

martencassel/netstat-pid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netstat-pid

Netstat-pid display 'netstat' connectivity information for processes and threads on a host.

  • Display network connections from all processes including threads on a host (default).
  • Display both hostname and container name if available, in the UTS namespace.
  • Displays network connections for a specific pid.
  • Write connectivity information as json to standard out.

How It Works

  1. Traverses the entire process tree and each thread
  2. Reads connection information from proc files tcp and tcp6, per process and thread.
  3. Outputs the connection information as JSON to stdout.

Usage

  1. List connections for a specific PID:

    ./netstat-pid 1
  2. List all connections from all process and threads:

    sudo ./netstat-pid
  3. List all connection to file

    sudo ./netstat-pid > netstat-output.json

Build

  1. Fedora 22

    make build-fedora-32
  2. Ubuntu 22.04

    make build-ubuntu-22.04

About

Display network connectivity information as json for all process and threads

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published