G
G
gremlintv22018-07-15 20:36:14
bash
gremlintv2, 2018-07-15 20:36:14

How to display the top 10 processes in BASH according to different load characteristics in a file?

Specifically, I'm interested in the top 10 in terms of load on:
CPU, RAM (physical), I / O, NETWORK
And if in the case of CPU and RAM it is enough to use ps aux
Then in the case of the top 10 processes in the I / O load, I did not find a ready-made solution
Ta the same trouble with the top 10 processes in the load on the network did not find a ready-made solution
. it's not a problem to go to the console and look through nload, iftop, iotop, dstat or others.
1) But how can I generate the top 10 (for io / network) in the form of a report for subsequent sending, let's say to my mail?
It is clear that just look at the load on block devices as a whole: /proc/diskstats or on network interfaces /proc/net/dev
2) Is it possible to get the top 10 using bash based only on /proc?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-07-16
@saboteur_kiev

1) Using cat/head/tail/sort/cut/awk/sed, you can cut out all the data you need and send it by mail
2) no, besides /proc, /dev is also useful

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question