Lsofgraph Python Save

python version of lsof to graphviz parser

Project README

Python version of zevv/lsofgraph

A small utility to convert Unix lsof output to a graph showing FIFO and UNIX interprocess communication.

Generate graph:

sudo lsof -n -F | python lsofgraph.py | dot -Tjpg > /tmp/a.jpg
    OR
sudo lsof -n -F | python lsofgraph.py | dot -T svg > /tmp/a.svg

or add unflatten to the chain for a better layout:

sudo lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T jpg > /tmp/a.jpg
    OR
sudo lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T svg > /tmp/a.svg

example output

Install and use on MacOS

Graphviz contains utilities dot and unflatten

brew install Graphviz
git clone https://github.com/akme/lsofgraph-python.git
cd lsofgraph-python
lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T jpg > /tmp/a.jpg && open /tmp/a.jpg
lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T svg > /tmp/a.jpg && open -a Safari.app '/tmp/a.svg'
Open Source Agenda is not affiliated with "Lsofgraph Python" Project. README Source: akme/lsofgraph-python
Stars
122
Open Issues
1
Last Commit
1 year ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating