As you all know, overheating is a serious enemy of MyBook hard disk.
The following patches to the web interface files adding a temperature read-out to the Disk Manager page under the Storage tab in Advanced Mode (see screenshot).
This patch has been tested under software version 01.02.14 on both a single and double drive system.
I assume the patch can be made to earlier version of the software as well.
The mod makes use of the SMARTCTL routine already present in the MBWE.
Just try it out by logging into the unit via SSH using Putty (user root).
Then type: /usr/sbin/smartctl -a -d ata /dev/sda |awk '/Temperature/ { print $10 }'
For the modification the following files were changed:
wixHooks.class | /proto/SxM_webui/admin/inc |
storage_disk_manage.php | /proto/SxM_webui/admin |
en.xml | /proto/SxM_webui/admin/lang |
Note that when you use the web interface in a different language, you should edit the correct language file.
(For English en.xml is used)
Before making changes to the three files, make a copy of the original file.
In wixHooks.class at approx line 2919 (just below "status") get the temperature of the drive(s) using SMARTCTL: // Status $status = trim(@file_get_contents('/etc/.smart_disk' . ($id + 1))); //NEW // Temperature coded by Ruud Broers aka Laservision, March 2013 ob_start(); // Turn on output buffering if($id == 0) { // Drive 0 or Drive 1 @system("/usr/sbin/smartctl -a -d ata /dev/sda |awk '/Temperature/ { print $10 }' "); } else { @system("/usr/sbin/smartctl -a -d ata /dev/sdb |awk '/Temperature/ { print $10 }' "); } $temperature = ob_get_contents(); // Capture the output into a variable ob_clean(); // Clean (erase) the output buffer In wixHooks.class at approx line 2950 copy the temperature: $diskinfo[$index]['status'] = $status; //* NEW * $diskinfo[$index]['temperature'] = $temperature; In storage_disk_manage.php at approx line 93 make the description column more narrow and add the extra column: <td class="listhdrr" style="width: 180px;" nowrap> <?=htmlspecialchars($lang['storage']['diskmanagement']['description']);?> </td> <!-- New field for temperature --> <td class="listhdrr" style="width: 80px;" nowrap> <?=htmlspecialchars($lang['storage']['diskmanagement']['temperature']);?> </td> In storage_disk_manage.php at approx line 149 insert the measure value: <td class="listrgrid" nowrap><?=($isMissing) ? '--' : $info['vendor'] . ' ' . $info['model']?></td> <!-- New field for temperature --> <td class="listrgrid" nowrap><?=($isMissing) ? '--' : $info['temperature'].'ºC'?></td> <td class="listrgrid"><?=($isMissing) ? 'Missing' : (($info['status'] == 0)?htmlspecialchars(__STR_GOOD__):(($info['status'] == 1)?htmlspecialchars(__STR_BAD__):(($info['status'] == 2)?htmlspecialchars(__STR_FOREIGN__):htmlspecialchars(__STR_NEW__))))?></td> In en.xml at approx line 469 add the column header: <storage> <title>Storage</title> <diskmanagement> <title>Disk Manager</title> <managedisk>Manage Disks</managedisk> <disk>Disk</disk> <size>Size</size> <description>Description</description> <!-- extra value for column header --> <temperature>Temperature</temperature> <status>Status</status> </diskmanagement>
!! Important: Make sure that you set the attributes for the three files correctly, otherwise it will not work!
In addition to Putty I use WinSCP (under Windows) to have a comfortable user interface to the filing system within the MBWE.
It's much easier than the command line and allows drag and drop. So you can copy a file to Windows, edit it and drag it back to the MBWE.
Contact me for a copy of the modified files
If you want the display in Fahrenheit, use
$celsius = ob_get_contents(); // Capture the output into a variable
$temperature=$celsius*9/5+32;
instead of
$temperature = ob_get_contents();
Regards,
Laservision