Giter Club home page Giter Club logo

lsofgraph's Introduction

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

Generate graph:

sudo lsof -n -F | ./lsofgraph | dot -Tjpg > /tmp/a.jpg

or add unflatten to the chain for a better layout:

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

It seems that Lua was an unfortunate choice, since people keep sending me links to ports in other languages. If you also hate Lua, raise your hand and check the Python port at https://github.com/akme/lsofgraph-python or the Perl port at https://github.com/tehmoth/lsofgraph.

example output

lsofgraph's People

Contributors

bjohnso5 avatar jmeichle avatar robertkeizer avatar zevv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lsofgraph's Issues

no output

$ sudo lsof -n -F | ./lsofgraph

$ lsof -v
lsof version information:
revision: 4.89
...

$ uname --kernel-release --kernel-version --operating-system
4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 GNU/Linux

Stuk

lsof -n -F | ./lsofgraph | dot -Tjpg > /tmp/lsof.jpg

Then you wait untill you an ons weight, but nothing heppens.

root@kbresearch:/opt/home/wfa010/lsofgraph# file /tmp/lsof.jpg
/tmp/lsof.jpg: JPEG image data, JFIF standard 1.01, comment: "CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), default quality"
root@kbresearch:/opt/home/wfa010/lsofgraph# ls -lah /tmp/lsof.jpg
-rw-rw-r-- 1 wfa010 wfa010 738 Feb 8 17:32 /tmp/lsof.jpg

doesn't work

~/D/lsofgraph ❯❯❯ sudo lsof | ./lsofgraph
digraph G {
        rankdir = LR;
        node [ shape=box, style="rounded,filled" width=0, height=0, fontname=Helvetica, fontsize=10];
        edge [ fontname=Helvetica, fontsize=10];
lua: ./lsofgraph:54: bad argument #2 to 'format' (number expected, got string)
stack traceback:
        [C]: in function 'format'
        ./lsofgraph:54: in function 'printf'
        ./lsofgraph:169: in main chunk
        [C]: in ?

similar output when using -n -F etc. (hacker news brought me here)

lsof on busybox

Hi,
thanks for this tool I love it on amd86 where lsof is a standalone command. It seems this will not work when lsof is part of busybox because the -F option output will look like:

1	/usr/lib/systemd/systemd	/dev/null
1	/usr/lib/systemd/systemd	/dev/null
1	/usr/lib/systemd/systemd	/dev/null
1	/usr/lib/systemd/systemd	/dev/kmsg
1	/usr/lib/systemd/systemd	anon_inode:[eventpoll]
1	/usr/lib/systemd/systemd	anon_inode:[signalfd]
1	/usr/lib/systemd/systemd	anon_inode:inotify
1	/usr/lib/systemd/systemd	/sys/fs/cgroup
1	/usr/lib/systemd/systemd	anon_inode:[timerfd]
1	/usr/lib/systemd/systemd	anon_inode:[eventpoll]

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.