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
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'