Difference between revisions of "Display HDD temperature in web interface"

From BubbaWiki
Jump to navigation Jump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<blockquote>'''Note''': As of software version 2.5 from Excito this is included in the official release. No need to do any changes.Maybe this page could/should be moved to an "archive"?<br></blockquote>
<br>
Hi,  
Hi,  


Line 5: Line 8:
I've attached the patch incase anyone else is interested in seeing it as well. Just make sure you have hddtemp installed (apt-get install hddtemp).  
I've attached the patch incase anyone else is interested in seeing it as well. Just make sure you have hddtemp installed (apt-get install hddtemp).  


Transfer the patch to your bubba and ssh in, now as root:<br>  
Transfer the patch to your bubba and ssh in. Then do:<br>  
<pre>cd /usr/share/web-admin/
<pre>su (use password 'excito')
patch --verbose -p0 &lt; /path/to/gui_hdd.patch</pre>  
apt-get update
<br>gui_hdd.patch (I'm not allow to upload it as an attachment, make sure there is no trailing empty line):<br>
apt-get install hddtemp
<pre>--- admin/controllers/stat.php.orig 2010-11-06 18:50:38.000000000 +0100
apt-get install patch
+++ admin/controllers/stat.php 2010-11-06 18:51:36.000000000 +0100
cd /usr/share/web-admin/
@@ -79,6 +79,7 @@
wget download.excito.net/software/gui_hdd.patch
$sdata['totalspace']=number_format($totalspace,0,' ',' ');
patch --verbose -p0 &lt; /usr/share/web-admin/gui_hdd.patch</pre>  
$sdata['percentused']=intval(100*(($totalspace-$freespace)/$totalspace));
<br>  
$sdata['notifications'] = $this-&gt;notify-&gt;list_all();
+ $sdata['hddtemp'] = $this-&gt;_getdisk('/dev/sda');


if($strip){
The result:  
$this-&gt;load-&gt;view(THEME.'/stat/stat_view',$sdata);
--- admin/views/default/stat/stat_view.php.orig  2010-11-06 18:51:02.000000000 +0100
+++ admin/views/default/stat/stat_view.php  2010-11-06 18:47:17.000000000 +0100
@@ -17,6 +17,7 @@
&lt;table class="ui-table-outline" id="ui-stat-list"&gt;
&lt;tr&gt;&lt;td class="ui-stat-list-col1"&gt;&lt;?=t('Disk capacity')?&gt;&lt;/td&gt;&lt;td class="ui-stat-list-col2"&gt;&lt;?=$totalspace?&gt; MB&lt;/td&gt;&lt;td /&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;?=t('Available')?&gt;&lt;/td&gt;&lt;td&gt;&lt;?=$freespace?&gt; MB&lt;/td&gt;&lt;td /&gt;&lt;/tr&gt;
+            &lt;tr&gt;&lt;td&gt;&lt;?=t('HDD temperature')?&gt;&lt;/td&gt;&lt;td&gt;&lt;?=$hddtemp['temp']?&gt;&lt;/td&gt;&lt;td /&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;?=t('Uptime')?&gt;&lt;/td&gt;&lt;td&gt;
&lt;? if($uptime[0]&gt;0) print($uptime[0]." ".t('days')." ");&nbsp;?&gt;
&lt;? printf("%02d",$uptime[1])?&gt;:&lt;? printf("%02d",$uptime[2])?&gt;:&lt;? printf("%02d",$uptime[3])?&gt;</pre>
<br>The result:  


[[Image:Gui patch.jpeg]]<br>  
[[Image:Gui patch.jpeg]]<br>  
Line 35: Line 24:
<br>  
<br>  


Note: This howto was copied with the writers permission from our [http://forum.excito.net/viewtopic.php?f=8&t=2662&sid=df3a8bcb3281a0303ef602fada399212&p=12627#p12563 forum], and originally written by [http://forum.excito.net/memberlist.php?mode=viewprofile&u=3122 [vEX]]. Our warmest thanks to him/her for this contribution!&nbsp;<br>
Note: This howto was copied by Excito with the writers permission from our [http://forum.excito.net/viewtopic.php?f=8&t=2662&sid=df3a8bcb3281a0303ef602fada399212&p=12627#p12563 forum], and originally written by [http://forum.excito.net/memberlist.php?mode=viewprofile&u=3122 [vEX]]. Our warmest thanks to him/her for this contribution!<br>
 
<br>  
 
/Johannes (Excito staff)

Latest revision as of 09:28, 1 July 2012

Note: As of software version 2.5 from Excito this is included in the official release. No need to do any changes.Maybe this page could/should be moved to an "archive"?


Hi,

I think it's nice to be able to see the HDD temperature in the web portal and started digging around. I found out that you already have the functionallity but it doesn't seem to be used anywhere (navigate to http://b3.local/admin/stat/info to get the JSON data). Hence I decided to hack it in myself.

I've attached the patch incase anyone else is interested in seeing it as well. Just make sure you have hddtemp installed (apt-get install hddtemp).

Transfer the patch to your bubba and ssh in. Then do:

su (use password 'excito')
apt-get update
apt-get install hddtemp
apt-get install patch
cd /usr/share/web-admin/
wget download.excito.net/software/gui_hdd.patch
patch --verbose -p0 < /usr/share/web-admin/gui_hdd.patch


The result:

Gui patch.jpeg


Note: This howto was copied by Excito with the writers permission from our forum, and originally written by [vEX]. Our warmest thanks to him/her for this contribution!