1

I can't find anything on how can I get the network I/O and disk I/O without installing any libraries on my server.

I tried with this for the disk I/O:

cut -d" " -f 1,2,42 /proc/*/stat | sort -n -k +3

And for network I/O I was thinking on parsing /proc/net/dev.

But I don't find a way to get this information.

  • Look at the iostat and netstat commands. – Scott Oct 13 '17 at 12:10
  • Both are external libraries. I want to do this without using/installing third parties libraries – Marcos Aguayo Oct 13 '17 at 12:32
  • 1
    What is a third-party library to you? If you're on Solaris, where the distinction is meaningful, iostat at least is part of the system. With Linux, would first-party include the kernel and git (i.e. stuff by Linus Torvalds), but not things like ls or bash (i.e. stuff by GNU)? The inverse of that? The collection of all things included in a base install of the distribution? If the latter, which distribution? – Fox Oct 13 '17 at 13:09
  • 2
    iostat and netstat are not libraries; they are binaries. They may or may not be linked against shared objects (aka libraries). The correct answer to this question seems to be "only install binaries that are statically linked". – DopeGhoti Oct 13 '17 at 16:12
0

Linux distributions generally install the very basics and you extend functionality with packages. Using Gnu tools is not an external library. However if you do not wish to install anything you can use C and use the Linux interfaces directly.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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