Page 1 of 12 12311 ... LastLast
Results 1 to 10 of 113

Thread: HowTo: Conky hddtemp

  1. #1
    Join Date
    Jun 2006
    Location
    Fairfax, VA
    Beans
    1,491
    Distro
    Ubuntu 6.06

    HowTo: Conky hddtemp

    How To get conky to display hard drive temperature as a non-root user

    Newer versions of Conky have hddtemp as a built in variable and the below guide is no longer necessary. See this this post on page 3 of this thread.

    Caveat:
    hddtemp requires root privledges to use.

    Workaround:
    use netcat as a non-root user to obtain the hard drive temperature.

    Prerequisites:
    1. conky installed & working apt-get install conky
    2. hddtemp installed apt-get install hddtemp

    note: this guide is if have one hard drive though can be modified to use more than one hard drive.

    config hddtemp to run as a daemon:
    # sudo gedit /etc/default/hddtemp
    Code:
    # Defaults for hddtemp initscript (/etc/init.d/hddtemp)
    # This is a POSIX shell fragment
    
    # Master system-wide hddtemp switch. The initscript will not run if it is not
    # set to true. STOP THE SERVICE BEFORE DISABLING IT!
    
    # [automatically edited by postinst, do not change line format or set it to
    # anything but false or true ]
    RUN_DAEMON="true"
    
    # List of devices you want to use with hddtemp. If none specified,
    # hddtemp will probe standard devices.
    DISKS="/dev/hda"  # your hard drive here hda or hdb etc.
    
    # List of devices you want to use with hddtemp, but that would not be
    # probed for a working sensor.
    DISKS_NOPROBE=""
    
    # IP address of the interface on which you want hddtemp to be bound
    # on. If none specified, goes to 127.0.0.1. Use 0.0.0.0 to bind hddtemp
    # on all interfaces.
    INTERFACE="127.0.0.1"
    
    # Port number on which you want hddtemp to listen on. If none specified,
    # the port 7634 is used.
    PORT="7634"
    
    # Database file to use. If none specified, /etc/hddtemp.db is used.
    #DATABASE="/etc/hddtemp.db"
    
    # Separator to use between fields. The default separator is '|'.
    #SEPARATOR="|"
    
    # Logging period (in seconds) for the temperatures.
    SYSLOG="300"  # 300 = every 5 minutes
    
    # Other options to pass to hddtemp
    OPTIONS=""
    edit your .conkyrc
    $ gedit .conkyrc

    add this line in the TEXT section:
    Code:
    TEXT
    Hard Drive Temp: ${execi 300 nc localhost 7634 | cut -c29-30 ;}C
    What it does:
    The conky command $execi executes netcat at an interval of 5 minutes at localhost on the port used by conky 7634 and the result is cut to only the number value, the 29th & the 30th characters of the netcat result above, the hd temp.

    example netcat result:
    |/dev/hda|FUJITSU MHT2060AT|44|C|

    determine YOUR cut values to use
    Why? Because the result will be the model name of your hard drive and not all drives are the same!
    $nc localhost 7634
    count the characters in YOUR result and use those values in your .conkyrc
    Last edited by tturrisi; March 19th, 2009 at 12:26 AM. Reason: newer versions of Conky

  2. #2
    Join Date
    Oct 2006
    Location
    Server Room
    Beans
    345
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HowTo: Conky hddtemp

    nice how-to!

  3. #3
    Join Date
    Jun 2006
    Location
    Fairfax, VA
    Beans
    1,491
    Distro
    Ubuntu 6.06

    Re: HowTo: Conky hddtemp

    Thanks!
    This is also a good workaround for those of us w/ laptops that cannot work with lm-sensors. At least it gives one some idea of the temp inside.

  4. #4
    Join Date
    Oct 2006
    Location
    France
    Beans
    69
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: HowTo: Conky hddtemp

    Hdd temp on Conky is one of the harder thing to put up for a beginner. Great "how to" thanks.

  5. #5
    Join Date
    Jan 2006
    Location
    Oxford, UK
    Beans
    102
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Conky hddtemp

    I get:

    Code:
    nick@cloanthus:~$ nc localhost 7634
    localhost [127.0.0.1] 7634 (?) : Connection refused
    any ideas?

  6. #6
    Join Date
    Jan 2006
    Location
    Oxford, UK
    Beans
    102
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Conky hddtemp

    D'oh! I had "/dev/da" in my hddtemp.conf rather than the more useful "/dev/sda"

    Apologies.

  7. #7

    Re: HowTo: Conky hddtemp

    hey,

    ok i upgraded to fiesty and my hdd temp doesn't work. when i run the command

    nc localhost 7634

    i get the temp, even when i run

    hddtemp /dev/sda

    again everything fine. but for some reason in conky 1.4.5 it's a no go. the code is still the same as well

    ${execi 1 nc 127.0.0.1 7634 | cut -c30-31 ;}C


    in the conkyrc file. any ideas???

    thanks,

    ephman

  8. #8
    Join Date
    Mar 2006
    Location
    localhost
    Beans
    571

    Re: HowTo: Conky hddtemp

    Quote Originally Posted by ephman View Post
    hey,

    ok i upgraded to fiesty and my hdd temp doesn't work. when i run the command

    nc localhost 7634

    i get the temp, even when i run

    hddtemp /dev/sda

    again everything fine. but for some reason in conky 1.4.5 it's a no go. the code is still the same as well

    ${execi 1 nc 127.0.0.1 7634 | cut -c30-31 ;}C


    in the conkyrc file. any ideas???

    thanks,

    ephman

    Are you sure you're cutting the right characters?

    In my upgrade to Feisty, I had to change
    ${execi 300 nc localhost 7634 | cut -c29-30 ;}
    to
    ${execi 300 nc localhost 7634 | cut -c54-55 ;}

  9. #9

    Re: HowTo: Conky hddtemp

    Are you sure you're cutting the right characters?

    In my upgrade to Feisty, I had to change
    ${execi 300 nc localhost 7634 | cut -c29-30 ;}
    to
    ${execi 300 nc localhost 7634 | cut -c54-55 ;}
    thank you it worked... but why?

    thanks,
    ephman

  10. #10
    Join Date
    Mar 2006
    Location
    localhost
    Beans
    571

    Re: HowTo: Conky hddtemp

    Quote Originally Posted by ephman View Post
    thank you it worked... but why?

    thanks,
    ephman
    There was a long standing bug with the 2.6.20 Feisty kernel that wouldn't allow SMART values to be read on SMART-enabled hard drives. It was fixed shortly before release, but one of the side effects is really long hard drive names filled with blank spaces and/or strange characters.

Page 1 of 12 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •