Remote temperature monitoring of MyBook World Edition II

My Western Digital MyBook World Edition II (so white lights version) is remotely located in a place that *may* prove to be a little on the warm side. Of course I can buy a cheap and cheerful wireless thermometer and rest the probe on the top of the MyBook case. This would allow me to monitor the air temperature from the comfort of my office.

What I really want to do though is take advantage of S.M.A.R.T. and monitor the temperatures of the two MyBook HDDs remotely via the network.

I cannot however find any software to do this that doesn't look like being a science project to understand and install.

If you know of something that will do this and which is free or inexpensive, please kindly share it!

Thank you!
61 answers Last reply
More about remote temperature monitoring mybook world edition
  1. Try CPU-Z hardware manager, it is very small and simple to understand.
  2. Many thanks, but like all the other applications that I've found that are not the aforementioned science kit to implement, it only detects the HDDs on my PC, not those of the MyBook hanging off the gigabit network. If I've missed a trick rather than CPU-Z Hardware Manager (nee Monitor) not doing what I need, please explain what I need to do for it to work. Cheers.
  3. The silence is deafening so it seems there isn't an easy answer. I have therefore purchased a couple of low cost digital thermometers; one placed directly on top of the MyBook and the other on the shelf next to it. For the record the former typically shows 37 deg C, so I presume the HDDs are probably in the high forties to low fifties. This is fine by me.
  4. Here is a script to get the disk activity, disk temperature(s), and the fan speed for the Western Digitial myBook World Edition II. Enjoy!

    #!/bin/sh
    # Get disk drive activity, disk temperature, and fan speed
    # for the WD myBook World Edition II
    #
    # Identify the two Disks for the WD MB WE II
    DISKS="/dev/sda /dev/sdb"
    # Identify the file controlling the WDC fan and speed
    FAN_DEVICE=/sys/devices/platform/wdc-fan
    FAN_SPEED=$FAN_DEVICE/speed
    # Location of the hdparm and smartctl utilities to be used
    # hdparm version 7.7 is known to work properly on the MBWE
    # see http://kyyhkynen.net/stuff/mybook/spindown.php
    HDPARM=/sbin/hdparm
    SMARTCTL=/usr/sbin/smartctl
    for D in $DISKS
    do
    $HDPARM -C $D
    if [ $? -le 1 ] ; then
    printf " %s is: %s\n" \
    $($SMARTCTL -d ata -A $D\
    |grep Temperature\
    |cut -c 5-28,88- )
    fi
    done
    echo ""
    echo "Current fan speed (percent): `cat ${FAN_SPEED}`"
    echo ""
    exit
  5. Now we're talking!
    TVM for that, Tony_77! :)
  6. So tantalisingly close I feel...

    Presuming that I need to use SSH I enabled this option via MyBook admin and then connected as root/welc0me using PuTTY.

    Copying the script to the clipboard, pasting it to Notepad (to strip out anything other than raw text), and then copying and pasting it again in to the PuTTY console generates the following errors:

    ~ # #!/bin/sh
    ~ # # Get disk drive activity, disk temperature, and fan speed
    ~ # # for the WD myBook World Edition II
    ~ # #
    ~ # # Identify the two Disks for the WD MB WE II
    ~ # DISKS="/dev/sda /dev/sdb"
    ~ # # Identify the file controlling the WDC fan and speed
    ~ # FAN_DEVICE=/sys/devices/platform/wdc-fan
    ~ # FAN_SPEED=$FAN_DEVICE/speed
    ~ # # Location of the hdparm and smartctl utilities to be used
    ~ # # hdparm version 7.7 is known to work properly on the MBWE
    ~ # # see http://kyyhkynen.net/stuff/mybook/spindown.php
    ~ # HDPARM=/sbin/hdparm
    ~ # SMARTCTL=/usr/sbin/smartctl
    ~ # for D in $DISKS
    > do
    > $HDPARM -C $D
    > if [ $? -le 1 ] ; then
    > printf " %s is: %s\n" \
    > $($SMARTCTL -d ata -A $D\
    > |grep Temperature\
    -sh: Syntax error: "|" unexpected
    ~ # |cut -c 5-28,88- )
    -sh: Syntax error: "|" unexpected
    ~ # fi
    -sh: Syntax error: "fi" unexpected
    ~ # done
    -sh: Syntax error: "done" unexpected
    ~ # echo ""
    echo "Current fan speed (percent): `cat ${FAN_SPEED}`"
    echo ""
    ~ # echo "Current fan speed (percent): `cat ${FAN_SPEED}`"
    cat: /sys/devices/platform/wdc-fan/speed: No such file or directory
    Current fan speed (percent):
    ~ # echo ""


    Whilst I follow some of the syntax from having seen Unix in a past life (I am not a software engineer!) I don't have enough knowledge to fix the problems myself, so if you can point me in the right direction I'd appreciate it please Tony_77.

    Even better if having debugged the script I can then learn how to save it to the MyBook and re-run it on demand.

    Many thanks!
  7. Guessing that the pipe symbols ( | ) are concatenators, I moved them on to the same line.

    The script now runs but fails with:

    -sh: /sbin/hdparm: Permission denied
  8. I have now replaced $HDPARM -C $D explicitly with hdparm -C $D having first done cd /sbin before pasting and executing the script, and also move "done" to the end :)

    i.e.

    cd /sbin

    and then:

    DISKS="/dev/sda /dev/sdb"
    FAN_DEVICE=/sys/devices/platform/wdc-fan
    FAN_SPEED=$FAN_DEVICE/speed
    SMARTCTL=/usr/sbin/smartctl
    for D in $DISKS
    do
    hdparm -C $D
    if [ $? -le 1 ] ; then
    printf " %s is: %s\n" \
    $($SMARTCTL -d ata -A $D\ |grep Temperature\ |cut -c 5-28,88- )
    fi
    echo ""
    echo "Current fan speed (percent): `cat ${FAN_SPEED}`"
    echo ""
    done

    The script now runs but only tells me the drive state (active/idle) before then complaining that printf cannot be found and neither can wdc-fan. Sure enough, neither do exist.

    Has this script actually been used before to show HDD temperatures on a MyBook WE II (WHITE lights, not blue) or is it a guess?
  9. This script runs on my "Blue Ring" version of the WD MBWE. I needed to install hdparm version 7.7 to make this work (I had to download and compile it on the MBWE - very easy to do). This is the output I get on my MBWE: (I call the macro mbstat.sh)

    MyBook01 login: root
    Password:
    # sh mbstat.sh

    /dev/sda:
    drive state is: active/idle
    Temperature_Celsius is: 47

    /dev/sdb:
    drive state is: active/idle
    Temperature_Celsius is: 50

    Current fan speed (percent): 50

    # exit

    Sorry about the confusion regarding the macro. I simply cut/paste it into this blog and the blog messed up the formatting. Looks like you figured it out.
  10. BTW the "|" symbols are "pipes" - used to splice output of one program to the input of another. The "\" are for continuation lines and need to be removed when combining lines together.

    ... Tony
  11. BTW: If you have the WD "White Lights" edition or applied the latest firmware upgrade for the Blue Ring edition, you will need to download and install the components that WD has choosen to lobotomize.

    See: http://mybookworld.wikidot.com/

    ... Tony
  12. A couple of other hints:

    1. Install WinSCP onto your PC (see: http://sourceforge.net/projects/winscp/ for the free download). This makes getting around the MBWE file system a lot easier and will allow you to do SCP "secure" uploads and downloads - albeit fairly slow (the MBWE uses a fairly slow processor so the encryption really slows file transfers when you use SCP).

    2. Browse (look but don't touch unless you really know linux shell scripting) the startup script files in the \etc\init.d directory. These will show you where WD has hidden things like hdparm and smartdrv and the wdc fan controller etc...

    3. Have fun. I have installed things like VSFTPD onto my MBWE, enabled the secure FTP, and integrated this with the Windows (Samba) share areas. I can use things like FileZilla ( see: http://filezilla-project.org/ ) to do secure FTP uploads and downloads from anywhere anywhere in the world. Great way to send digital pictures from your camera to your now secure filer and to download media (things like digitized movies .avi, .wmv. mp4. etc ) to your netbook or pocket PC when you are travelling (remember that MIONET doesn't allow .jpeg,s, avi's, .mp3's, .mp4's, .wmv's, etc.).
  13. Thanks very much Tony.
    Much appreciated.

    It's late and I've had a enough beers to screw things up if I dabble now, so I'll do so over the weekend instead if the kids give me some breathing space.

    Stay tuned!
  14. I did a little more testing of the temp monitor script I posted to this blog, so I cut the temp monitor script from this blog and pasted it back into my WD MBWE (Blue Rings) as a file under the \root directory calling it mbstat2.sh

    I then executed the script file using the command "sh mbstat2.sh" and things worked perfectly - so this blog's version of the script is really OK other than the non-indented formatting. This script is meant to be saved as a file and "executed" by the Linux shell via the "sh" command in order to run it.

    If you so choose, you can make the script file executable using the "chmod +x" command and place the script somewhere into the PATH. Then you won't need to use the "sh" command - you can just run the script directly.

    My WD MBWE II is the Blue Rings edition and I am running firmware 02.00.19 - the most recent for this edition. When I applied this latest firmware update, I discovered that WD had lobotomized the Linux that was installed on the MBWE and I had to recover what they removed. There are tutorials on http://mybookworld.wikidot.com/ on how to do this.

    Unfortunately, I don't have access to a "White Lights" version of the MBWE. Wish I did, it's processor is twice as fast as the "Blue Rings" and it has four times the internal memory. I would be able to do a lot more neat stuff with it. So I can't give you much help with how to configure the script for "White Lights".

    Having said this, I suspect that both the hdparm program and the smartdrv program are installed somewhere on the White Lights edition. All you should have to do is set the FAN_DEVICE, FAN_SPEED, HDPARM, and SMARTCTL script variables to the appropriate locations and you would be good to go! By examining the startup files in the /etc/init.d directory, you should be able to find out where WD "hid" these things in the "White Lights" version.

    The Linux command "type" can be used to locate files in the search PATH. ie: "type hdparm" to locate hdparm ... etc. I have attached an example of how to do this.

    The printf, grep, and cut programs are very standard Linux programs and I can't imagine that WD lobotomized those on the "White Lights" edition. It just could be that the PATH variable is not being set properly for the root account and that the shell simply can't find these very standard Linux programs. You need to do a little research on this. Try a command like "printf --help" to see if the shell can find it, "usage" information should be returned.

    Example follows:

    MyBook01 login: root
    Password:
    # type printf
    printf is a shell builtin
    # type grep
    grep is /bin/grep
    # type cut
    cut is /usr/bin/cut
    # type hdparm
    hdparm is /sbin/hdparm
    # type smartctl
    smartctl is /usr/sbin/smartctl
    # exit
    logout

    Hope this helps. I wish WD wouldn't be so anal-retentive when it comes to the MBWE. This NAS has real possibilities.

    ... Tony
  15. More tips:

    1. To get files into the your directory (such as the temp monitor script) you can use the command "cat >filename" where filename is the name of the file you want to create. You need to "cd" into the directory you want first. You "cut/paste" the text from notepad into your PuTTY terminal session and the lines will be written to the file. When the paste is finished, type a CONTROL-D to indicate end-of-file and the "cat" program will exit. If you mess up you can remove the file with a "rm filename".

    2. Better yet install WinSCP on your PC. You can drag and drop files wherever you want onto your MBWE. WinSCP has a built-in editor so you can edit directly on the MBWE. You can also quickly look at the startup script files in the \etc\init.d directory. WinSCP also handles the Linux <-> Windows text conversions for end-of-line control characters.

    3. WinSCP has a very handy Terminal Window built-in where you can run a single command and get the answer back. This is a great place to execute the temp monitor script. The output fits very nicely into the WinSCP Terminal Window and there is no other clutter. WinSCP can also hand-off to PuTTY.

    4. Because the MBWE is a filer, you can simply open your MBWE folder in Windows and drag files to it (even Linux script files). The files end up in this directory: \shares\internal\<your user name>\<your folder> where "<your user name>" is your userid on the MBWE and "<your folder>" is where you dragged the file to. You can use the "cp" command (the Linux copy command) or the "mv" command (the Linux move command) to move the files where you want them to end up.

    Hope this helps.

    ... Tony
  16. The kids are in bed so I've made a faster start than I expected to. Thanks for the tip, Tony: WinSCP is brilliant! :) So much faster than navigating around in a command console and using clunky old vi (which is how I previously edited /usr/mionet/monitorCVM.sh to stop Mionet restarting every 15 minutes despite being disabled in the admin console)

    Turning to my missing applets, this is what I found:

    /$ cd /
    /$ type wdc-fan
    wdc-fan: not found
    /$ wdc-fan --help
    -sh: wdc-fan: not found
    /$ type printf
    printf: not found
    /$ printf --help
    -sh: printf: not found

    I am therefore sure they are not installed rather than installed but in an obscure place.
    I took a long walk around http://mybookworld.wikidot.com/ but cannot find the tutorial you refer to for me to install them, probably because I am searching on inappropriate guesses. If you can point me a little more closely that would be great, thank you!
  17. I assume you were able to verify the existence of the hdparm, smartctl, grep, and cut program.

    Now that you have WinSCP, if you haven't discovered it yet - WinSCP has a "Find Files" function on the toolbar which can scan the entire disk farm if need be. You can search for "printf" this way.

    Now on my Blue Rings MBWE the printf program is built into the shell.
    It is also installed in \usr\bin .

    We should find out if printf is built into the white lights version of the MBWE. Use the command "sh - c help" to find out what is built-in.

    Use the WinSCP "Find Files" function to see if it exists anywhere.

    Use the command "echo $PATH" to see if \usr\bin (or where-ever the white-lights version of printf is located) is indeed on the search path for programs.

    Let us know what you find, and we'll go from there.

    On my MBWE (Blue Rings), I get: (you can see printf in the list of programs)

    MyBook01 login: root
    Password:
    # sh -c help
    GNU bash, version 3.1.17(1)-release (arm-unknown-linux-gnu)
    These shell commands are defined internally. Type `help' to see this lis
    Type `help name' to find out more about the function `name'.
    Use `info bash' to find out more about the shell in general.
    Use `man -k' or `info' to find out more about commands not in this list.

    A star (*) next to a name means that the command is disabled.

    JOB_SPEC [&] (( expression ))
    . filename [arguments] :
    [ arg... ] [[ expression ]]
    alias [-p] [name[=value] ... ] bind [-lpvsPVS] [-m keymap] [-f fi
    break [n] builtin [shell-builtin [arg ...]]
    caller [EXPR] case WORD in [PATTERN [| PATTERN].
    cd [-L|-P] [dir] command [-pVv] command [arg ...]
    compgen [-abcdefgjksuv] [-o option complete [-abcdefgjksuv] [-pr] [-o
    continue [n] declare [-afFirtx] [-p] [name[=val
    dirs [-clpv] [+N] [-N] echo [-neE] [arg ...]
    enable [-pnds] [-a] [-f filename] eval [arg ...]
    exec [-cl] [-a name] file [redirec exit [n]
    export [-nf] [name[=value] ...] or false
    fc [-e ename] [-nlr] [first] [last for NAME [in WORDS ... ;] do COMMA
    for (( exp1; exp2; exp3 )); do COM function NAME { COMMANDS ; } or NA
    getopts optstring name [arg] hash [-lr] [-p pathname] [-dt] [na
    help [-s] [pattern ...] history [-c] [-d offset] [n] or hi
    if COMMANDS; then COMMANDS; [ elif kill [-s sigspec | -n signum | -si
    let arg [arg ...] local name[=value] ...
    logout popd [+N | -N] [-n]
    printf [-v var] format [arguments] pushd [dir | +N | -N] [-n]
    pwd [-LP] read [-ers] [-u fd] [-t timeout] [
    readonly [-af] [name[=value] ...] return [n]
    select NAME [in WORDS ... ;] do CO set [--abefhkmnptuvxBCHP] [-o opti
    shift [n] shopt [-pqsu] [-o long-option] opt
    source filename [arguments] test [expr]
    time [-p] PIPELINE times
    trap [-lp] [arg signal_spec ...] true
    type [-afptP] name [name ...] typeset [-afFirtx] [-p] name[=valu
    ulimit [-SHacdfilmnpqstuvx] [limit umask [-p] [-S] [mode]
    unalias [-a] name [name ...] unset [-f] [-v] [name ...]
    until COMMANDS; do COMMANDS; done variables - Some variable names an
    wait [n] while COMMANDS; do COMMANDS; done
    { COMMANDS ; }


    #


    AND on my MBWE (Blue Rings), I get: (you can see :/usr/bin: in the list)


    # echo $PATH
    /bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/bin:/opt/bin:.
    #
  18. This wiki drives me nuts! The " :/ " is really a ":" immediately followed by a "/"

    ... Tony
  19. Hi Tony,

    Thanks for such commitment to helping me.
    I am amazed!

    This is what "echo $PATH" returns: /usr/bin:/bin:/usr/sbin:/sbin
    Unfortunately "sh - c help" fails with "Can't open c"
    Using "find files" on the root folder, printf is nowhere to be found

    Off to bed now before I get shot! :)

    Cheers!
  20. :/ for : / indeed! Grrrrrrr :fou: !
  21. Wow! I can't believe how much lobotomy WD has done to the MBWE since the initial release of the Blue Rings edition. I guess they figured that folks were just having to much fun adding functionality to it. My blessings to WD: "May the front lawns of the WD headquarters be fertilized by the dung from one million North American Bison - every other day."

    I checked http://mybookworld.wikidot.com/ on how to recover programs lobotomized by WD. Turns out the recovery is only for the Blue Rings edition and I wouldn't recommend trying it on the White Lights edition.

    But, I am still undaunted. We have a couple of choices here:

    1. I can make the printf program from the Blue Rings edition of the WD MBWE available to you and you can simply FTP it onto your MBWE. Since both editions of the MBWE use the processor from Oxford Semiconductor, that should work.

    2. If WD hasn't removed gcc (the "C" compiler), you can download the printf source and make files and compile it back onto your MBWE by using your MBWE - the poetic justice solution. Use the command "type gcc" to see if the MBWE shell can find gcc? (But I suspect WD lobotimized that as well. Did I say 1 million Bison, I meant 2 million Bison and every day!)

    3. Use the reworked script that follows. I have removed the requirement for printf - the whole thing relies on using the echo command - not very elegant but what the hey! The script now checks to see if the wdc-fan device can be found where expected. The fan speed only displays if it can be found. You will need to update the HDPARM and the SMARTCTL variables to the location of where these programs are installed on your MBWE white lights edition. The "type hdparm" and "type smartdrv" commands should give you this information. Remember that Linux is case-sensitive.

    I have called the reworked script mbstat.sh and copied it into the /root directory of my MBWE from where I run it from the root account as follows:

    # sh mbstat.sh

    Date: Fri Mar 12 23:10:47 PDT 2010
    uptime: 13 days, 23:47 hours
    load average: 0.00, 0.00, 0.00

    /dev/sda:
    drive state is: active/idle
    Temperature_Celsius is: 52

    /dev/sdb:
    drive state is: active/idle
    Temperature_Celsius is: 54

    Current fan speed (percent): 0

    #

    (I added the Date:, uptime:, and load average. You will need to check for the existence of the date and uptime programs by using the "type" command (ie: "type date" and "type uptime"). If they have been lobotomized by WD, just comment out the corresponding echo commands in the script.)

    The reworked script (mbstat.sh) follows:

    #!/bin/sh
    # Get disk drive activity, disk temperature, and fan speed
    # for the WD myBook World Edition II (Blue Rings)
    #
    # Identify the two Disks for the WD MB WE II:
    DISKS="/dev/sda /dev/sdb"
    # Identify the file controlling the WDC fan and speed:
    FAN_DEVICE=/sys/devices/platform/wdc-fan
    FAN_SPEED=$FAN_DEVICE/speed
    # Location of the hdparm and smartctl utilities to be used:
    HDPARM=/sbin/hdparm
    SMARTCTL=/usr/sbin/smartctl
    # note: hdparm version 7.7 is known to work properly on the MBWE
    # see http://kyyhkynen.net/stuff/mybook/spindown.php
    # The following tag is used to identify the line within
    # the attributes returned by SMARTCTL in order to get
    # the internal HD temperature readings.
    THE_TEMP="Temperature_Celsius"
    echo ""
    echo "Date: `date`"
    echo " uptime:`uptime | cut -d, -f1-2 | cut -c13-` hours"
    echo "`uptime | cut -d, -f4-6`"
    for D in $DISKS
    do
    $HDPARM -C $D
    if [ $? -le 1 ] ; then
    echo " $THE_TEMP is: `$SMARTCTL -d ata -A $D \
    |grep "$THE_TEMP" | cut -c88-`"
    fi
    done
    if test -r "$FAN_SPEED" ; then
    echo ""
    echo "Current fan speed (percent): `cat ${FAN_SPEED}`"
    fi
    echo ""
    exit
  22. A couple of places to look for things:

    On my WD MBWE Blue Rings, the variables HDPARM and SMARTCTL that located the corresponding programs were found in the file: /etc/init.d/S15wdc-heat-monitor

    On my WD MBWE Blue Rings, the variables FAN_DEVICE and FAN_SPEED that located the corresponding devices were found in the file: /etc/init.d/S20wdc-fan-test

    You can use WinSCP to edit these files if they or something similar exists on the MBWE White Lights (these are simple shell script files).

    I think the MBWE White Lights edition has a thermistor temperature sensor on the processor board as well. Since I have the Blue Rings edition, I can't be sure. However do look at: http://hacksomethingtonight.blogspot.com/2010/02/wd-mybook-hacks-temperature-readings.html There maybe something of interest there.

    If you would like to replace missing programs, let me know which ones and I'll put the Blue Rings version up onto a public FTP share somewhere. The Linux command for downloading programs from an http: site or and ftp: site is "wget". Hopefully that has not been lobotomized as well. Try "type wget" to see if the MBWE shell can find it.

    Let me know.

    CIAO - Think Open Source

    ... Tony
  23. If you are looking for something to do, the mbstat.sh script can be called from another script that loops around - say every 10 minutes or so and the output of mbstat.sh can be written to the "PUBLIC" share as a text file where you can use MS WORDPAD to look at it whenever you want. Hint - to get mbstat.sh to output to the public share, the command would be:

    sh mbstat.sh >/shares/internal/PUBLIC/mbstat.txt

    Enjoy!

    ... Tony
  24. Thanks again Tony, and for the output syntax for when we get the basic script running A very nice idea.

    You were correct - gcc does not exist.

    I ran the script and this is the outcome:

    Date: Sat Mar 13 13:16:54 GMT 2010
    mbstat.sh: mbstat.sh: 30: /sbin/hdparm: Permission denied
    uptime: 1 day, 12:15 hours
    2.06, 2.01
    mbstat.sh: mbstat.sh: 30: /sbin/hdparm: Permission denied

    Using WinSCP I see that although hdparm both exists and does so in the expected /sbin folder, it has zero byte size.
  25. BTW - At least wget exists :)

    /$ type wget
    wget is /usr/bin/wget
  26. Have you found the script file in the /etc/init.d directory that references HDPARM? On the MBWE it is called /etc/init.d/S15wdc-heat-monitor

    If you could post a copy of this, maybe I can figure out what WD has done...

    The version of hdparm that I have on my MBWE is 64,060 bytes. If the copy you have in /sbin is 0 bytes, WD must have hidden another copy somewhere else. What does "type hdparm" get you?

    As I recall, you said you were able to run hdparm by typing the command into the console. Things to try (and post or e-mail the result back to me and I'll try to figure out what WD did):

    MyBook01 login: root
    Password:
    # type hdparm
    hdparm is /sbin/hdparm
    # type smartctl
    smartctl is /usr/sbin/smartctl
    #
    # hdparm -C /dev/sda

    /dev/sda:
    drive state is: active/idle
    #
    #
    # hdparm -C /dev/sdb

    /dev/sdb:
    drive state is: active/idle
    #
    #
    # smartctl -d ata -A /dev/sda
    smartctl version 5.33 [arm-unknown-linux-gnu] Copyright (C) 2002-4 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF READ SMART DATA SECTION ===
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_
    FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x100f 200 200 051 Pre-fail Always -
    0
    3 Spin_Up_Time 0x0003 176 175 021 Pre-fail Always -
    6183
    4 Start_Stop_Count 0x0032 100 100 000 Old_age Always -
    440
    5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always -
    0
    7 Seek_Error_Rate 0x000e 200 200 051 Old_age Always -
    0
    9 Power_On_Hours 0x0032 091 091 000 Old_age Always -
    6866
    10 Spin_Retry_Count 0x0012 100 100 051 Old_age Always -
    0
    11 Calibration_Retry_Count 0x0012 100 100 051 Old_age Always -
    0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always -
    104
    192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always -
    99
    193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always -
    440
    194 Temperature_Celsius 0x0022 099 090 000 Old_age Always -
    51
    196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always -
    0
    197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always -
    0
    198 Offline_Uncorrectable 0x0010 200 200 000 Old_age Offline -
    0
    199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always -
    0
    200 Multi_Zone_Error_Rate 0x0008 200 200 051 Old_age Offline -
    0

    #
    #
    # smartctl -d ata -A /dev/sdb
    smartctl version 5.33 [arm-unknown-linux-gnu] Copyright (C) 2002-4 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF READ SMART DATA SECTION ===
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_
    FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x100f 200 200 051 Pre-fail Always -
    0
    3 Spin_Up_Time 0x0003 178 177 021 Pre-fail Always -
    6075
    4 Start_Stop_Count 0x0032 100 100 000 Old_age Always -
    454
    5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always -
    0
    7 Seek_Error_Rate 0x000e 200 200 051 Old_age Always -
    0
    9 Power_On_Hours 0x0032 091 091 000 Old_age Always -
    6944
    10 Spin_Retry_Count 0x0012 100 100 051 Old_age Always -
    0
    11 Calibration_Retry_Count 0x0012 100 100 051 Old_age Always -
    0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always -
    125
    192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always -
    123
    193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always -
    454
    194 Temperature_Celsius 0x0022 096 089 000 Old_age Always -
    54
    196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always -
    0
    197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always -
    0
    198 Offline_Uncorrectable 0x0010 200 200 000 Old_age Offline -
    0
    199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always -
    0
    200 Multi_Zone_Error_Rate 0x0008 200 200 051 Old_age Offline -
    0

    #
    #
    #
    # hdparm --version

    hdparm - get/set hard disk parameters - version v7.7

    Usage: hdparm [options] [device] ..

    Options:
    -a get/set fs readahead
    -A get/set the drive look-ahead flag (0/1)
    -b get/set bus state (0 == off, 1 == on, 2 == tristate)
    -B set Advanced Power Management setting (1-255)
    -c get/set IDE 32-bit IO setting
    -C check drive power mode status
    -d get/set using_dma flag
    -D enable/disable drive defect management
    -E set cd-rom drive speed
    -f flush buffer cache for device on exit
    -F flush drive write cache
    -g display drive geometry
    -h display terse usage information
    -H read temperature from drive (Hitachi only)
    -i display drive identification
    -I detailed/current information directly from drive
    -k get/set keep_settings_over_reset flag (0/1)
    -K set drive keep_features_over_reset flag (0/1)
    -L set drive doorlock (0/1) (removable harddisks only)
    -M get/set acoustic management (0-254, 128: quiet, 254: fast)
    -m get/set multiple sector count
    -n get/set ignore-write-errors flag (0/1)
    -p set PIO mode on IDE interface chipset (0,1,2,3,4,...)
    -P set drive prefetch count
    -q change next setting quietly
    -Q get/set DMA tagged-queuing depth (if supported)
    -r get/set device readonly flag (DANGEROUS to set)
    -R register an IDE interface (DANGEROUS)
    -s set power-up in standby flag (0/1) (DANGEROUS)
    -S set standby (spindown) timeout
    -t perform device read timings
    -T perform cache read timings
    -u get/set unmaskirq flag (0/1)
    -U un-register an IDE interface (DANGEROUS)
    -v defaults; same as -acdgkmur for IDE drives
    -V display program version and exit immediately
    -w perform device reset (DANGEROUS)
    -W get/set drive write-caching flag (0/1)
    -x tristate device for hotswap (0/1) (DANGEROUS)
    -X set IDE xfer mode (DANGEROUS)
    -y put drive in standby mode
    -Y put drive to sleep
    -Z disable Seagate auto-powersaving mode
    -z re-read partition table
    --direct use O_DIRECT to bypass page cache for timings
    --Istdin read identify data from stdin as ASCII hex
    --Istdout write identify data to stdout as ASCII hex
    --verbose display extra diagnostics from some commands
    --security-help display help for ATA security commands
    --drq-hsm-error crash system with a "stuck DRQ" error (VERY DANGEROUS)

    #
    #
    #
    #
    # smartctl --version
    smartctl version 5.33 [arm-unknown-linux-gnu] Copyright (C) 2002-4 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    smartctl comes with ABSOLUTELY NO WARRANTY. This
    is free software, and you are welcome to redistribute it
    under the terms of the GNU General Public License Version 2.
    See http://www.gnu.org for further details.

    CVS version IDs of files used to build this code are:
    Module: atacmdnames.c revision: 1.11 date: 2004/01/02
    uses: atacmdnames.h revision: 1.3 date: 2004/01/02
    Module: atacmds.c revision: 1.161 date: 2004/08/18
    uses: atacmds.h revision: 1.73 date: 2004/08/18
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: extern.h revision: 1.39 date: 2004/08/13
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: ataprint.c revision: 1.156 date: 2004/09/10
    uses: atacmdnames.h revision: 1.3 date: 2004/01/02
    uses: atacmds.h revision: 1.73 date: 2004/08/18
    uses: ataprint.h revision: 1.26 date: 2004/01/27
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: extern.h revision: 1.39 date: 2004/08/13
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: knowndrives.h revision: 1.10 date: 2004/01/02
    uses: smartctl.h revision: 1.21 date: 2004/01/29
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: knowndrives.c revision: 1.118 date: 2004/08/21
    uses: atacmds.h revision: 1.73 date: 2004/08/18
    uses: ataprint.h revision: 1.26 date: 2004/01/27
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: extern.h revision: 1.39 date: 2004/08/13
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: knowndrives.h revision: 1.10 date: 2004/01/02
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: os_linux.c revision: 1.72 date: 2004/08/25
    uses: atacmds.h revision: 1.73 date: 2004/08/18
    uses: os_linux.h revision: 1.21 date: 2004/08/16
    uses: scsicmds.h revision: 1.52 date: 2004/09/05
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: scsicmds.c revision: 1.78 date: 2004/09/05
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: extern.h revision: 1.39 date: 2004/08/13
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: scsicmds.h revision: 1.52 date: 2004/09/05
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: scsiprint.c revision: 1.89 date: 2004/09/06
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: extern.h revision: 1.39 date: 2004/08/13
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: scsicmds.h revision: 1.52 date: 2004/09/05
    uses: scsiprint.h revision: 1.18 date: 2004/01/27
    uses: smartctl.h revision: 1.21 date: 2004/01/29
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: smartctl.c revision: 1.135 date: 2004/08/18
    uses: atacmds.h revision: 1.73 date: 2004/08/18
    uses: ataprint.h revision: 1.26 date: 2004/01/27
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: extern.h revision: 1.39 date: 2004/08/13
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: knowndrives.h revision: 1.10 date: 2004/01/02
    uses: scsicmds.h revision: 1.52 date: 2004/09/05
    uses: scsiprint.h revision: 1.18 date: 2004/01/27
    uses: smartctl.h revision: 1.21 date: 2004/01/29
    uses: utility.h revision: 1.38 date: 2004/08/18
    Module: utility.c revision: 1.54 date: 2004/08/29
    uses: configure.in revision: 1.101 date: 2004/09/07
    uses: int64.h revision: 1.8 date: 2004/09/07
    uses: utility.h revision: 1.38 date: 2004/08/18

    smartmontools release 5.33 dated 2004/09/10 at 04:11:35 UTC
    smartmontools build host: arm-unknown-linux-gnu
    smartmontools build configured: 2008/01/18 09:41:55 UTC
    smartctl compile dated Jan 18 2008 at 09:42:03
    smartmontools configure arguments: '--target=arm-linux' '--host=arm-linux' '--bu
    ild=i386-pc-linux-gnu' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin'
    '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--datadir=/us
    r/share' '--localstatedir=/var' '--mandir=/usr/man' '--infodir=/usr/info' '--dis
    able-nls' 'CC=/data/WD_v2.0_RC15/buildroot/build_arm_nofpu/staging_dir/bin/arm-l
    inux-uclibc-gcc' 'CFLAGS=-O2 ' 'CPP=/data/WD_v2.0_RC15/buildroot/build_arm_nofpu
    /staging_dir/bin/arm-linux-uclibc-cpp' 'build_alias=i386-pc-linux-gnu' 'host_ali
    as=arm-linux' 'target_alias=arm-linux'
    #
  27. I am really starting to think that the White Lights has been intentionally crippled.

    No other hdparm and no S15wdc-heat-monitor

    /$ type hdparm
    hdparm is /usr/sbin/hdparm

    /$ type S15wdc-heat-monitor
    S15wdc-heat-monitor: not found

    Regarding running hdparm: It doesn't so much run as not fail if you get my drift! i.e. when assigned to a variable in your original script I got an insufficient permissions error but when called directly it did nothing. If I type sh /sbin/hdparm I simple I simply jump down a line in the command window. Seems it really does have zero bytes as indicated by the file size display in WinSCP.
  28. Can you run your smartctl program at least. This is the program that exposes the HD temperature. Try the command: smartctl -d ata -A /dev/sda
    and with any luck one of the lines smartctl will display will be "Temperature_Celsisus". See the example in my prior post. If the White Lights version of smartctl is able to generate anything sensible, I'll make a White Lights version of the script and post it. So if you could post the output or e-mail it to me, I'll see what I can do. Also try the command: "uptime" and post the results.
    From your prior posts, the White Lights version of uptime seems to be doing strange things. If I know what it produces, I can adjust the script accordingly.

    I'm up to 3 million North American Bision twice a day for WD at this point...

    ... Tony
  29. Yeah, Tony! :)
    Something that hasn't been crippled at last!

    /$ smartctl -d ata -A /dev/sda
    smartctl version 5.38 [arm-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF READ SMART DATA SECTION ===
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
    3 Spin_Up_Time 0x0027 163 159 021 Pre-fail Always - 6833
    4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 227
    5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
    7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
    9 Power_On_Hours 0x0032 095 095 000 Old_age Always - 3798
    10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
    11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 51
    192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 4
    193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 227
    194 Temperature_Celsius 0x0022 103 098 000 Old_age Always - 47
    196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
    197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
    198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
    200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0


    /$ uptime
    14:52:02 up 2 days, 13:50, load average: 2.05, 2.03, 2.04


    Thank you for your kind offer; terrific, in a word.
  30. ...and by deduction from an earlier post that "sdb" relates to the second disc, here's the current output for both sda and sdb

    /root$ smartctl -d ata -A /dev/sda
    smartctl version 5.38 [arm-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF READ SMART DATA SECTION ===
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
    3 Spin_Up_Time 0x0027 163 159 021 Pre-fail Always - 6833
    4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 227
    5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
    7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
    9 Power_On_Hours 0x0032 095 095 000 Old_age Always - 3804
    10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
    11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 51
    192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 4
    193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 227
    194 Temperature_Celsius 0x0022 106 098 000 Old_age Always - 44
    196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
    197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
    198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
    200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0

    /root$ smartctl -d ata -A /dev/sdb
    smartctl version 5.38 [arm-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen
    Home page is http://smartmontools.sourceforge.net/

    === START OF READ SMART DATA SECTION ===
    SMART Attributes Data Structure revision number: 16
    Vendor Specific SMART Attributes with Thresholds:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 0
    3 Spin_Up_Time 0x0027 158 155 021 Pre-fail Always - 7066
    4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 231
    5 Reallocated_Sector_Ct 0x0033 199 199 140 Pre-fail Always - 1
    7 Seek_Error_Rate 0x002e 200 200 000 Old_age Always - 0
    9 Power_On_Hours 0x0032 095 095 000 Old_age Always - 3804
    10 Spin_Retry_Count 0x0032 100 100 000 Old_age Always - 0
    11 Calibration_Retry_Count 0x0032 100 253 000 Old_age Always - 0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 51
    192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 4
    193 Load_Cycle_Count 0x0032 200 200 000 Old_age Always - 231
    194 Temperature_Celsius 0x0022 106 097 000 Old_age Always - 44
    196 Reallocated_Event_Count 0x0032 199 199 000 Old_age Always - 1
    197 Current_Pending_Sector 0x0032 200 200 000 Old_age Always - 0
    198 Offline_Uncorrectable 0x0030 200 200 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
    200 Multi_Zone_Error_Rate 0x0008 200 200 000 Old_age Offline - 0


    Do I take it that the raw value for Temperature_Celsius is exactly that?
    i.e both discs are currently 44 deg C?

    If so, it'd be nice to know how to interpret the "worst" column for this attribute assuming that it is a maximum (high) value. :)
  31. Yep - the last number is the current real temperature. You will have to consult the Western Digitial technical documentation on the WD WEB site for the maximum temperature allowed for your model drives. The missing "hdparm" actually can tell you what model drives are installed.

    My drives run between 48 and 55 Celsius, but they are the older drives (ie: not then new WD "green" drives which run much cooler). The fan in my MBWE kicks in at 55 Celsius.

    There is documentation on the net for the "SMART" attributes. If you can figure it out, please let all of us know how the other attributes are formatted and interpreted.

    In any case you do have the smartdrv program and that is the key piece you needed.

    I have configured my MBWE to serve up the missing files we have discovered so far as well as a copy of my temp monitor scripts. I also have a Readme.txt file served up describing how to download the missing files onto your MBWE and where they need to go. If you need additional files, please let me know and I'll post them.

    The site is:

    ftp://ampatrick.dyndns.org/MBWE

    MBWE being the directory where I stashed all this stuff. The site is read-only and uses anonymous FTP, so you don't need a login ID. If you are reading the Readme.txt file on Windows you need to use WordPad (and not NoteBook). Unix derived systems have different line ending characters which WordPad can handle and NoteBook cannot.

    Let me know if this works for you.

    ... Tony
  32. Looks like the MBWE "White Lights" edition of "uptime" has one fewer column that the Blue Rings edition...

    You will need to change the line:
    echo "`uptime | cut -d, -f4-6`"
    to
    echo "`uptime | cut -d, -f3-5`"
    in the scripts so you can see the loading on your MBWE.

    Let me know how this works out.

    ... Tony
  33. Hi Tony.

    Great, thanks!
    Files all downloaded now with the only hurdle being needing to twig that dyndsn was meant to be dyndns :)
    Thankfully this took all of two seconds!

    Unfortunately the script (uptime line edited) still fails with an hdparm permissions error that has me totally baffled:

    /$ sh mbstat.sh

    Date: Mon Mar 15 10:23:11 GMT 2010
    mbstat.sh: mbstat.sh: 30: /sbin/hdparm: Permission denied
    uptime: 3 days, 9:21 hours
    load average: 2.29, 2.07, 2.05
    mbstat.sh: mbstat.sh: 30: /sbin/hdparm: Permission denied

    I just don't get it!
    I now have a valid hdparm file in the correct /sbin location and I can both see and open it (okay, it's guff when I do, but I can at least open it and it is no longer zero bytes).


    I've being doing some digging in parallel with your kind help and learned that the Western Digital 3.5in Caviar Green SATA 2 HDDs (part number WD10EAVS-00D7B1) in my MBWEII are judged to have such a low power consumption that they don't need forced cooling. They rely entirely on convection within the box and then radiation from the box. There is no fan. This would explain why we couldn't find wdc-fan I guess :)

    After the MyBook slept for the night with all computers and media streamers on the home network switched off (actually slept = idled at reduced speed rather than a true sleep since this is what the inactivity state induces) the HDDs both reported 30 deg C this morning. After an hour of reasonably intense usage they were reporting 39 deg C versus 32.5 deg C for the probe that I rested on the top of the MyBook enclosure. All in the same ballpark within the bounds of experimental error and influencing factors.


    Now, back to that hdparm... What on earth is going on?! :o
  34. Whoops! Sorry for the typo, I corrected the post and the Readme.txt

    As for the hdparm problem, you may need to mark hdparm as being executable.
    Try:

    chmod +x /sbin/hdparm

    also for printf ie:

    chmod +x /usr/bin/printf

    Let me know if this works.

    ... Tony
  35. Thanks Tony. I ran the command and it certainly worked as the right hand pane in WinSCP now confirms "rmx" (previously rm) for hdparm.

    Now though I get this when I try to run mbstat:

    /$ sh mbstat.sh

    Date: Mon Mar 15 16:15:15 GMT 2010
    uptime: 1:45, load average: 0.24 hours
    0.85, 1.20
    mbstat.sh: mbstat.sh: 30: /sbin/hdparm: not found
    mbstat.sh: mbstat.sh: 30: /sbin/hdparm: not found

    Talk about chasing something down! :)
  36. BTW: the drives in your White Lights MBWE (model WD10EAVS drives) are rated for a maximum operating temperature of 55 degrees Celsius.

    See: http://wdc.custhelp.com/cgi-bin/wdc.cfg/php/enduser/std_adp.php?p_faqid=1679

    for details.
    ... Tony
  37. Yes, thanks.
    I found that out from a different WD source (http://www.wdc.com/en/library/sata/2879-701229.pdf) but at least something is consistent :)
  38. Try the following and tell me what you get:

    cd /sbin
    hdparm --version

    ... Tony
  39. /$ cd /sbin
    /sbin$ hdparm --version

    hdparm - get/set hard disk parameters - version v8.9

    Usage: hdparm [options] [device] ..

    Options:
    -a get/set fs readahead
    -A get/set the drive look-ahead flag (0/1)
    -b get/set bus state (0 == off, 1 == on, 2 == tristate)
    -B set Advanced Power Management setting (1-255)
    -c get/set IDE 32-bit IO setting
    -C check drive power mode status
    -d get/set using_dma flag
    -D enable/disable drive defect management
    -E set cd-rom drive speed
    -f flush buffer cache for device on exit
    -F flush drive write cache
    -g display drive geometry
    -h display terse usage information
    -H read temperature from drive (Hitachi only)
    -i display drive identification
    -I detailed/current information directly from drive
    -k get/set keep_settings_over_reset flag (0/1)
    -K set drive keep_features_over_reset flag (0/1)
    -L set drive doorlock (0/1) (removable harddisks only)
    -M get/set acoustic management (0-254, 128: quiet, 254: fast)
    -m get/set multiple sector count
    -N get/set max visible number of sectors (HPA) (VERY DANGEROUS)
    -n get/set ignore-write-errors flag (0/1)
    -p set PIO mode on IDE interface chipset (0,1,2,3,4,...)
    -P set drive prefetch count
    -q change next setting quietly
    -Q get/set DMA queue_depth (if supported)
    -r get/set device readonly flag (DANGEROUS to set)
    -R obsolete
    -s set power-up in standby flag (0/1) (DANGEROUS)
    -S set standby (spindown) timeout
    -t perform device read timings
    -T perform cache read timings
    -u get/set unmaskirq flag (0/1)
    -U obsolete
    -v defaults; same as -acdgkmur for IDE drives
    -V display program version and exit immediately
    -w perform device reset (DANGEROUS)
    -W get/set drive write-caching flag (0/1)
    -x obsolete
    -X set IDE xfer mode (DANGEROUS)
    -y put drive in standby mode
    -Y put drive to sleep
    -Z disable Seagate auto-powersaving mode
    -z re-read partition table
    --direct use O_DIRECT to bypass page cache for timings
    --drq-hsm-error crash system with a "stuck DRQ" error (VERY DANGEROUS)
    --fibmap show device extents (and fragmentation) for a file
    --fibmap-sector show absolute LBA of a specfic sector of a file
    --Istdin read identify data from stdin as ASCII hex
    --Istdout write identify data to stdout as ASCII hex
    --make-bad-sector deliberately corrupt a sector directly on the media (VERY DANGEROUS)
    --read-sector read and dump (in hex) a sector directly from the media
    --security-help display help for ATA security commands
    --verbose display extra diagnostics from some commands
    --write-sector repair/overwrite a (possibly bad) sector directly on the media (VERY DANGEROUS)
  40. OK! We now know that hdparm works... but I see version 8.9 (which is very interesting) and not version 7.7 (which should have been what was downloaded from my server). This just gets stranger and stranger...

    Try:
    cd /root
    type hdparm
    cd /sbin
    type hdparm
    hdparm -I /dev/sda

    and let me know what you get.
    ... Tony
  41. I think you are on to something :)
    I have two copies of hdparm; on in /sbin and one in /usr/sbin.
    The one I copied from your server I placed in /sbin having first renamed the original (zero byte) file to hdparm_original rather than delete it or have it overwritten.

    Here's the info you asked for:

    /sbin$ cd /root
    /root$ type hdparm
    hdparm is a tracked alias for /usr/sbin/hdparm
    /root$ cd /sbin
    /sbin$ type hdparm
    hdparm is a tracked alias for /usr/sbin/hdparm
    /sbin$ hdparm -I /dev/sda

    /dev/sda:

    ATA device, with non-removable media
    Model Number: WDC WD10EAVS-00D7B1
    Serial Number: WD-WCAU4A428172
    Firmware Revision: 01.01A01
    Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5
    Standards:
    Supported: 8 7 6 5
    Likely used: 8
    Configuration:
    Logical max current
    cylinders 16383 16383
    heads 16 16
    sectors/track 63 63
    --
    CHS current addressable sectors: 16514064
    LBA user addressable sectors: 268435455
    LBA48 user addressable sectors: 1953525168
    device size with M = 1024*1024: 953869 MBytes
    device size with M = 1000*1000: 1000204 MBytes (1000 GB)
    Capabilities:
    LBA, IORDY(can be disabled)
    Queue depth: 32
    Standby timer values: spec'd by Standard, with device specific minimum
    R/W multiple sector transfer: Max = 16 Current = 0
    Recommended acoustic management value: 128, current value: 254
    DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
    Cycle time: min=120ns recommended=120ns
    PIO: pio0 pio1 pio2 pio3 pio4
    Cycle time: no flow control=120ns IORDY flow control=120ns
    Commands/features:
    Enabled Supported:
    * SMART feature set
    Security Mode feature set
    * Power Management feature set
    * Write cache
    * Look-ahead
    * Host Protected Area feature set
    * WRITE_BUFFER command
    * READ_BUFFER command
    * NOP cmd
    * DOWNLOAD_MICROCODE
    Power-Up In Standby feature set
    * SET_FEATURES required to spinup after power up
    SET_MAX security extension
    Automatic Acoustic Management feature set
    * 48-bit Address feature set
    * Device Configuration Overlay feature set
    * Mandatory FLUSH_CACHE
    * FLUSH_CACHE_EXT
    * SMART error logging
    * SMART self-test
    * General Purpose Logging feature set
    * 64-bit World wide name
    * Segmented DOWNLOAD_MICROCODE
    * SATA-I signaling speed (1.5Gb/s)
    * SATA-II signaling speed (3.0Gb/s)
    * Native Command Queueing (NCQ)
    * Host-initiated interface power management
    * Phy event counters
    DMA Setup Auto-Activate optimization
    * Software settings preservation
    * SMART Command Transport (SCT) feature set
    * SCT Long Sector Access (AC1)
    * SCT LBA Segment Access (AC2)
    * SCT Error Recovery Control (AC3)
    * SCT Features Control (AC4)
    * SCT Data Tables (AC5)
    unknown 206[12] (vendor specific)
    unknown 206[13] (vendor specific)
    Security:
    Master password revision code = 65534
    supported
    not enabled
    not locked
    not frozen
    not expired: security count
    supported: enhanced erase
    244min for SECURITY ERASE UNIT. 244min for ENHANCED SECURITY ERASE UNIT.
    Logical Unit WWN Device Identifier: 50014ee11c39ffb
    NAA : 5
    IEEE OUI : 14ee
    Unique ID : 11c39ffb
    Checksum: correct
  42. For info the rights on the /usr/sbin copy of hdparm are rwxrwxr-x so I presume this tells me it is executable.
  43. OK.. The zero length hdparm you had in /sbin must have been messing things up. You need to delete the hdparm you downloaded from me: ie:

    rm /sbin/hdparm

    then you need to edit the script identifying where the "native" hdparm lives.
    So the line in the script becomes:

    HDPARM=/usr/sbin/hdparm

    then try running the script again.

    Let me know what you get.

    ... Tony
  44. Y E A H ! :bounce:

    /$ sh mbstat.sh

    Date: Mon Mar 15 17:15:54 GMT 2010
    uptime: 2:46, load average: 0.72 hours
    0.31, 0.17

    /dev/sda:
    drive state is: active/idle
    Temperature_Celsius is: 47

    /dev/sdb:
    drive state is: active/idle
    Temperature_Celsius is: 46

    Fantastic! :)
    I am so grateful, thank you, Tony.
    In fact, having been similarly doggedly determined to see things through on other occasions when I have helped people, it has been delightful to be on the receiving end for a change. The bonus here is that I have learned enough dangerous new skills that I've got the motivation to finish the job off and learn rather a lot more about my MBWEII and BusyBox specifically as well as Linus generally.

    Now for me to go back and read what you suggested about a script to periodically call the fileand write the output to a text file I can read with a short cut to it. :)
  45. Linus=Linux of course (for some reason I can type an edit but not save it)
  46. Whew! Glad to help.

    The MBWE is really a neat little NAS filer. I also got rid of MIONET and installed VSFTPD (which is how you were able to FTP from my MBWE). You may want to consider doing VSFTPD as well if the White Lights edition doesn't already have a built-in secure FTP server. VSFTPD supports "secure" FTP modes which encrypt and validate user ids. See: http://vsftpd.beasts.org/

    VSFTPD is available as a pre-compiled module using the "optware" download method. See http://mybookworld.wikidot.com/ for details.

    It looks like you might have lost your edits to the "uptime" piece in the script. Should be two echo commands in the script:

    echo " uptime:`uptime | cut -d, -f1-2 | cut -c13-` hours"
    echo "`uptime | cut -d, -f3-5`"

    If you could re-test and verify, I'll post a "White Lights" version of the script on my server. You might also want to do your edits (HDPARM and uptime) to mbstat2.sh (it uses "printf") and test that for me as well to see if it will work on "White Lights".

    When you become comfortable with the scripting, you might want to consider outputting a CVS style file (one row every ten minutes or so) using comma separated columns into your PUBLIC share area (ie: /shares/internal/PUBLIC). You just need: the raw date, raw time, disk id (ie: sda or sdb), disk activity (a - active/idle; s - standby), temperature

    You can then directly open the file using MS excel and create a nice graph of activity and temperature versus time.

    ... Tony
  47. Script mbstat.sh:

    The echo stuff is there, so you can post your White Lights version as proven working :)

    uptime: 2:46, load average: 0.72 hours
    0.31, 0.17

    The uptime hours is obvious but I'll do some Googling now to learn how to interpret the load values.

    Script mbstat2.sh
    I ran chmod on printf as you requested but the script still fails:


    /dev/sda:
    drive state is: active/idle
    mbstat2.sh: mbstat2.sh: 25: printf: not found

    /dev/sdb:
    drive state is: active/idle
    mbstat2.sh: mbstat2.sh: 25: printf: not found


    Note that I modified the script too as below to comment out that wdc-fan related elements as my MBWEII doesn't have a fan and consequently no wdc-fan file:

    #!/bin/sh
    # Get disk drive activity, disk temperature, and fan speed
    # for the WD myBook World Edition II
    #
    # Identify the two Disks for the WD MB WE II
    DISKS="/dev/sda /dev/sdb"
    # Identify the file controlling the WDC fan and speed
    #FAN_DEVICE=/sys/devices/platform/wdc-fan
    #FAN_SPEED=$FAN_DEVICE/speed
    # Location of the hdparm and smartctl utilities to be used
    # hdparm version 7.7 is known to work properly on the MBWE
    # see http://kyyhkynen.net/stuff/mybook/spindown.php
    HDPARM=/usr/sbin/hdparm
    SMARTCTL=/usr/sbin/smartctl
    for D in $DISKS
    do
    $HDPARM -C $D
    if [ $? -le 1 ] ; then
    printf " %s is: %s\n" \
    $($SMARTCTL -d ata -A $D\ |grep Temperature\ |cut -c 5-28,88- )
    fi
    #echo ""
    #echo "Current fan speed (percent): `cat ${FAN_SPEED}`"
    #echo ""
    done
    exit


    Scripting:
    Yes, I will certainly have a play to do this! :)
  48. I have added a wlstat.sh script and updated the Readme.txt file on my MBWE ftp server for those who have a White Lights edition of the MBWE. The wlstat.sh script should work on a White Lights edition without any edits. After downloading, simply login to your MBWE using SSH and:

    sh wlstat.sh

    to display date, loading, disk activity, and disk temperature for your MBWE.

    The download (and Readme file) is available from:

    ftp://ampatrick.dyndns.org/MBWE


    MBWE being the directory where I stashed all this stuff. The site is read-only and uses anonymous FTP, so you don't need a login ID. If you are reading the Readme.txt file on Windows you need to use WordPad (and not NoteBook). Unix derived systems have different line ending characters which WordPad can handle and NoteBook cannot.


    Let me know if this works for you.


    ... Tony
  49. You will be needing the "printf" program to work if you want to do any kind of sensible formatted output (like CSV files). If you would like to continue with getting a temperature monitor CSV file that can work with excel, I would be willing to help (as I will be building one for my Blue Rings edition as well).

    First we need to figure out why the command shell on the White Lights edition can't find "printf" when it is running a script. Try the following commands (don't script these - just type them or cut/paste them) and tell me what you get:

    type printf
    /usr/bin/printf "Hello %s - now testing %s" Tony printf
    ls -l /bin/test
    ls - l /usr/bin/test
Ask a new question

Read More

NAS / RAID Western Digital Temperature Monitor Storage