The officially official Devuan Forum!

You are not logged in.

#1 2019-07-09 16:08:51

Altoid
Member
Registered: 2017-05-07
Posts: 1,581  

[Solved] Disk access monitor for ASCII

Hello:

I run Devuan ASCII on a rig with four SAS drives with various uses plus an outdated Miyo install to play with.

groucho@devuan:~$ uname -a
Linux devuan 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u3 (2019-06-16) x86_64 GNU/Linux
groucho@devuan:~$ 
groucho@devuan:~$ sudo blkid
[sudo] password for groucho: 
/dev/sda1: UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sdb1: LABEL="devuan" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sdb3: UUID="UUID DATA" TYPE="swap" PARTUUID="UUID DATA"
/dev/sdb5: UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sdb6: LABEL="home" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sdc5: LABEL="storage" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sdd1: LABEL="Miyo" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sdd2: UUID="UUID DATA" TYPE="swap" PARTUUID="UUID DATA"
/dev/sdd5: LABEL="Home" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sde1: LABEL="Backup" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
/dev/sde2: LABEL="Oldstuff" UUID="UUID DATA" TYPE="ext4" PARTUUID="UUID DATA"
groucho@devuan:~$ 

My installation includes both BackInTime and TimeShift (saved my skin more than once) which run according to their settings.

I know that BackInTime is running because of the pop-ups and panel icon + the audible disk drive writing.

But at times I hear the drive/s working and nothing in Conky's TOP display indicates what could be running.

Is there a utility that I could run and look at after the fact to see what is going on?
Maybe it is something I'm not needing or should not be running.

Thanks in advance,

A.

Last edited by Altoid (2019-07-11 21:54:43)

Offline

#2 2019-07-09 16:36:01

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Disk access monitor for ASCII

Altoid wrote:

Is there a utility that I could run and look at after the fact to see what is going on?

There is iotop but you would have to either leave it running or pipe it to conky.


Brianna Ghey — Rest In Power

Offline

#3 2019-07-09 21:22:20

Altoid
Member
Registered: 2017-05-07
Posts: 1,581  

Re: [Solved] Disk access monitor for ASCII

Hello:

Head_on_a_Stick wrote:

There is iotop ...

Thanks, it could be what I need.

It seems more like a disk performance monitor but the data I need could probably be obtained from the output ...

TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND 

... using data from just TID/PID, USER and COMMAND.

Head_on_a_Stick wrote:

... but you would have to either leave it running or pipe it to conky.

The best idea would be to pipe it to Conky so when I hear the drives I can just look at the display and see who is writing to disk.
I've looked around but have not been able to find an example of Conky using iotop and just a couple of posts from long ago asking.

Would you have one?

Thanks in advance,

A.

Offline

#4 2019-07-10 11:00:49

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: [Solved] Disk access monitor for ASCII

Put something like this in your conkyrc.

 ${color lightgrey}Disk I/O:	${color}${diskio sda}	${color}${diskio sdb}	

Offline

#5 2019-07-11 12:38:47

Altoid
Member
Registered: 2017-05-07
Posts: 1,581  

Re: [Solved] Disk access monitor for ASCII

Hello:

fsmithred wrote:

... this in your conkyrc.

Thanks, but I'm afraid it won't do.

What I need is to be able to look at my screen (eg: conky) and see something similar to what this does but for disc access/activity.
It gives me data on the top 5 processes and the % CPU time they take up.

Unfortunately, for some reason backintime and timeshift do not show up and maybe some other activity does not either. 
And I'd really like to know what is writing to my drives when more than usual activity is heard.

TOP 5 PROCESSES
${hr 2}
$processes processes ($running_processes running)
${alignr}${top_mem 1} %
${top_mem name 2}${alignr}${top mem 2} %
${top_mem name 3}${alignr}${top mem 3} %
${top_mem name 4}${alignr}${top mem 4} %
${top_mem name 5}${alignr}${top mem 5} %
${top_mem name 6}${alignr}${top mem 6} %

I don't need to check anything but who (process/programme) and where (disk drive/partition).
So if I hear unusual drive activity, this will give show me if it is something I want/need (eg: backintime/timeshift) or something else I should be aware of.

Most utilities I have found are benchmark oriented, designed to check if there are bottlenecks and such but I've not found anything security oriented (?) like my use would seem to be.

Maybe iotop might do but I cannot get it to run in conky nor have I found an example online.

Thanks for your input.

A.

Offline

#6 2019-07-11 13:44:29

Panopticon
Member
Registered: 2018-01-27
Posts: 306  

Re: [Solved] Disk access monitor for ASCII

Maybe you could log ioptop somehow using maybe logger?

iotop needs root though.

Here you go this might be what you are looking for.

https://www.binarytides.com/monitor-disk-io-iotop-cron/

Last edited by Panopticon (2019-07-11 13:50:34)

Offline

#7 2019-07-11 15:33:45

Altoid
Member
Registered: 2017-05-07
Posts: 1,581  

Re: [Solved] Disk access monitor for ASCII

Panopticon wrote:

... might be what you are looking for.
https://www.binarytides.com/monitor-disk-io-iotop-cron/

Thanks.
I'll have a look.

But logging IOTOP is sort of after the fact.

Best,

A.

Offline

#8 2019-07-11 15:38:33

Panopticon
Member
Registered: 2018-01-27
Posts: 306  

Re: [Solved] Disk access monitor for ASCII

So is conky really, you are only going to get information on the event as it happens and passes, atleast with logging IOTOP when you dont know how to parse it through conky for the event you are investigating, you may have some real data to go on that may help figure out the issue in a log you can share here.

Last edited by Panopticon (2019-07-11 15:46:54)

Offline

#9 2019-07-11 15:52:24

Altoid
Member
Registered: 2017-05-07
Posts: 1,581  

Re: [Solved] Disk access monitor for ASCII

Hello:

Panopticon wrote:

So is conky really, you are only going to get information on the event as it happens ...

Indeed, which is more or less what I want to do.

Just check out that it is nothing that looks out of the ordinary/expected, so to speak.
If it were, I'd then go on to check the usual files in /var/log to see what was going on.

Panopticon wrote:

... logging the event you have some real data to go on that may help you figure out the issue.

Yes, you are quite right there.  =-)

But unless my rig's configuration has gone astray, I do not really expect unusual stuff.
What got me asking about this is that the process, which I expect is BackInTime or TimeShift related, is not getting shown in conky (don't know why).

It happened this morning about an hour past my boot-time and I ran iotop to see what was working.
In this particular case it was BackInTime cleaning up excess/older snapsots (actually it was rsync).

Thnaks a lot for your input.

Best,

A.

Offline

#10 2019-07-11 18:10:51

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,486  

Re: [Solved] Disk access monitor for ASCII

I had a similar symptom once, and in my case it was due to excessive logging in /var/log/auth.log from everyone trying to get into my open ssh port. I moved the port and solved the problem. Probably not the case here, but I thought I should mention it.

Offline

#11 2019-07-11 19:25:52

Altoid
Member
Registered: 2017-05-07
Posts: 1,581  

Re: [Solved] Disk access monitor for ASCII

Hello:

fsmithred wrote:

I had a similar symptom once, and in my case ...

Thanks for the heads up.  =-)
I will check anyhow.

I finally found an applicable case.  See: https://superuser.com/questions/363337/ … -processes
It solves a similar case with a Conky variable I had overlooked: top_io.  See: http://conky.sourceforge.net/variables.html

${top_io name 1} ${top_io io_perc 1} ${top_io cpu 1} ${top_io mem 1}

top_io takes arguments in the form: top_io (name) (number).

Processes are sorted by the amount of I/O the process has done during the update interval, which is what (number) represents.
The types are: "name", "pid", "cpu", "mem", "mem_res", "mem_vsize", "time", "uid", "user", "io_perc", "io_read" and "io_write".
There can be a max of 10 processes listed.

I used it with just NAME, CPU and MEM, which is just the information I needed.
Four processes is probably too many for my use and I'll trim it eventually:

Disk I/O
${hr 2}
NAME${alignr}CPU  MEM
${top_io name 1}${alignr}${top_io cpu 1} ${top_io mem 1}
${top_io name 2}${alignr}${top_io cpu 2} ${top_io mem 2}
${top_io name 3}${alignr}${top_io cpu 3} ${top_io mem 3}
${top_io name 4}${alignr}${top_io cpu 4} ${top_io mem 4}

Cheers,

A.

Last edited by Altoid (2019-07-11 19:34:54)

Offline

Board footer