You are not logged in.

#1 2009-07-21 23:35:13

murderbymodem
Member
From: New Jersey
Registered: 2008-07-24
Posts: 41

Conky to monitor disk space.

Okay, I'm trying to modify Southie75's conky config for my own use, and running into some problems.

Here is the disk part of the config:

${alignc}Disks
${alignr}Writes/Reads
Root ($color${fs_type /}${color0}) ${alignr}$color${diskio_write /dev/sda2}${color0}/$color${diskio_read /dev/sda2}
${fs_used /}${color0}/$color${fs_size /} ${alignr}$color${fs_used_perc /}% ${color0}${fs_bar 8,100 /}

Vista ($color${fs_type /home/southie/vista}${color0}) ${alignr}$color${diskio_write /dev/sda1}${color0}/$color${diskio_read /dev/sda1}
${fs_used /home/southie/vista}${color0}/$color${fs_size /home/southie/vista} ${alignr}$color${fs_used_perc /home/southie/vista}% ${color0}${fs_bar 8,100 /home/southie/vista}

Backup ($color${fs_type /home/southie/mnt}${color0}) ${alignr}$color${diskio_write /dev/sdb2}${color0}/$color${diskio_read /dev/sdb2}
${fs_used /home/southie/mnt}${color0}/$color${fs_size /home/southie/mnt} ${alignr}$color${fs_used_perc /home/southie/mnt}% ${color0}${fs_bar 8,100 /home/southie/mnt}

Now, my version:

${alignc}Disks
${alignr}Writes/Reads
Root ($color${fs_type /}${color0}) ${alignr}$color${diskio_write /dev/sda2}${color0}/$color${diskio_read /dev/sda2}
${fs_used /}${color0}/$color${fs_size /} ${alignr}$color${fs_used_perc /}% ${color0}${fs_bar 8,100 /}

Home ($color${fs_type /}${color0}) ${alignr}$color${diskio_write /dev/sdd4}${color0}/$color${diskio_read /dev/sdd4}
${fs_used /}${color0}/$color${fs_size /} ${alignr}$color${fs_used_perc /}% ${color0}${fs_bar 8,100 /}

Anime ($color${fs_type /media/Anime}${color0}) ${alignr}$color${diskio_write /dev/sda1}${color0}/$color${diskio_read /dev/sda1}
${fs_used /media/Anime}${color0}/$color${fs_size /media/Anime} ${alignr}$color${fs_used_perc /media/Anime}% ${color0}${fs_bar 8,100 /media/Anime}

Storage ($color${fs_type /media/Storage}${color0}) ${alignr}$color${diskio_write /dev/sdc1}${color0}/$color${diskio_read /dev/sdc1}
${fs_used /media/Storage}${color0}/$color${fs_size /media/Storage} ${alignr}$color${fs_used_perc /media/Storage}% ${color0}${fs_bar 8,100 /media/Storage}

It seems to work, but the probem is that every time I show down my computer and boot it up again, conky will not start because the /dev/XXX has changed. I asked about this on IRC, and was linked to the wiki about persistent block device naming (http://wiki.archlinux.org/index.php/Per … ice_naming), but I don't really understand how to make it work with the conky config.

Offline

#2 2009-07-21 23:55:50

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Conky to monitor disk space.

First take a close look at /bin/ls -lF /dev/disk/by-uuid/ to see which symlinks point to the devices you want. And then in conky use those instead ${diskio_read /dev/disk/by-uuid/yyyyyyy}

Offline

#3 2009-07-22 00:16:38

murderbymodem
Member
From: New Jersey
Registered: 2008-07-24
Posts: 41

Re: Conky to monitor disk space.

$ /bin/ls -lF /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 086015D76015CBF6 -> ../../sdc1
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 1FCE38490AF84BBA -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 3C693BB801316E01 -> ../../sdb1
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 6A55ED1A765187B7 -> ../../sdb2
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 6e24d1db-3363-4261-bac4-45e10a39c5a2 -> ../../sdd4
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 ad6e5ae5-1ea6-49ca-b45d-ca9fcdfdb618 -> ../../sdd1
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 d1c3bf9f-3554-4d6a-aafd-e3bf719ae255 -> ../../sda2
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 e2ada9b5-0d59-46aa-a5a5-e46089eeaa44 -> ../../sdd2
lrwxrwxrwx 1 root root 10 2009-07-21 14:41 eeb92087-e378-452e-8cbb-47541961cf65 -> ../../sdd3

Then I ran

df -l

and saw that the drive I wanted was:

/dev/sda1            576717400 457374532 119342868  80% /media/Anime

so I tried:

Anime ($color${fs_type /dev/disk/by-uuid/1FCE38490AF84BBA}${color0}) ${alignr}$color${diskio_write /dev/disk/by-uuid/1FCE38490AF84BBA}${color0}/$color${diskio_read /dev/disk/by-uuid/1FCE38490AF84BBA}
${fs_used /dev/disk/by-uuid/1FCE38490AF84BBA}${color0}/$color${fs_size /dev/disk/by-uuid/1FCE38490AF84BBA} ${alignr}$color${fs_used_perc /dev/disk/by-uuid/1FCE38490AF84BBA}% ${color0}${fs_bar 8,100 /dev/dis$y-uuid/1FCE38490AF84BBA}% ${color0}${fs_bar 8,100 /dev/disk/by-uuid/1FCE38490AF84BBA}

and conky says

Conky: diskio device '../../sda1' does not exist
Conky: diskio device '../../sda1' does not exist

What did I miss? Do I need to include that whole first part too?

Last edited by murderbymodem (2009-07-22 00:17:22)

Offline

#4 2009-07-22 00:25:17

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Conky to monitor disk space.

No you were right with the first few, so leave the mounted /media directories as they are and just change the /dev/xxx like
${diskio_write /dev/sdc1}
${diskio_read /dev/sdc1}

BTW in fstab you mount the media directories, don't those get mixed up too?

Offline

#5 2009-07-22 00:49:50

murderbymodem
Member
From: New Jersey
Registered: 2008-07-24
Posts: 41

Re: Conky to monitor disk space.

Procyon wrote:

No you were right with the first few, so leave the mounted /media directories as they are and just change the /dev/xxx like
${diskio_write /dev/sdc1}
${diskio_read /dev/sdc1}

BTW in fstab you mount the media directories, don't those get mixed up too?

I haven't done anything with the fstab, I read that wiki page about persistent naming but I didn't understand it. I tried to do it by label and then use the labels in the conky config but it didn't work. What do I have to change in that file? All I know is that I can see the drive in pcmanfm and it says /media/Anime.

changed my conkyrc to:

Anime ($color${fs_type /media/Anime}${color0}) ${alignr}$color${diskio_write /dev/disk/by-uuid/1FCE38490AF84BBA}${color0}/$color${diskio_read /dev/disk/by-uuid/1FCE38490AF84BBA}
${fs_used /media/Anime}${color0}/$color${fs_size /media/Anime} ${alignr}$color${fs_used_perc /media/Anime}% ${color0}${fs_bar 8,100 /media/Anime}

but I still get

Conky: statfs '/dev/dis$y-uuid/1FCE38490AF84BBA': No such file or directory
Conky: diskio device '../../sda1' does not exist
Conky: diskio device '../../sda1' does not exist

note that the "dis$y-" part is typed right in the conkyrc. I don't know why it says that in the error message.

Last edited by murderbymodem (2009-07-22 02:25:33)

Offline

#6 2009-07-22 09:56:56

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: Conky to monitor disk space.

Hmm.. I think that means when conky looks up the information it needs the /dev/sda1 string to find the record.

I don't use conky so I don't know how to go around that. Can you use ${diskio_read ${script that returns /dev/sda1}}? Try it out with something like ${diskio_read ${exec echo /dev/sda1}}

About fstab, you can simply substitute the /dev/sdxx lines so you get lines like
/dev/disk/by-uuid/1FCE38490AF84BBA /media/Anime xfs etc,etc

Offline

#7 2009-09-03 20:44:57

slums
Member
From: Poland
Registered: 2009-04-21
Posts: 15

Re: Conky to monitor disk space.

have you tried changing your current directory, before starting conky ?

cd /dev/disk/by-uuid/; conky -c /path/to/your/conkyrc

you shouldn't get the " '../../sda1' does not exist " error wink

Offline

#8 2009-09-03 21:12:46

ruscook
Member
From: Sydney Australia
Registered: 2007-08-27
Posts: 105
Website

Re: Conky to monitor disk space.

Why not use the mounted partition name, rather than the device name. I.e. use {fs_free /} for root, {fs_free /home} for home etc.

Here's the relevant section from my .conkyrc :

${color7}${font}DISK ${color0}${hr}
${voffset 1}${color7}${font}${font Dejavu Sans:bold:size=10}${alignr}                   Free     Used         Size   % Free
${voffset 6}${font Pie charts for maps:size=14}7${font}${color1} ${voffset -5}Root:${alignr}$color ${fs_free /}${color lightgrey} ${fs_used /} /$color ${fs_size /} - ${fs_free_perc /}%
${voffset 6}${fs_bar 12 /}
${voffset 6}${font Pie charts for maps:size=14}7${font}${color1} ${voffset -5}Home:${alignr}$color ${fs_free /home}${color lightgrey} ${fs_used /home}/$color ${fs_size /home} - ${fs_free_perc /home}%
${voffset 6}${fs_bar 12 /home}

Russ

Last edited by ruscook (2009-09-03 21:14:03)

Offline

Board footer

Powered by FluxBB