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

From BubbaWiki
Jump to navigation Jump to search
(Created page with '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 see...')
 
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Hi,
<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>


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.
Hi,


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 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.  


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


if($strip){
Transfer the patch to your bubba and ssh in. Then do:<br>
$this-&gt;load-&gt;view(THEME.'/stat/stat_view',$sdata);
<pre>su (use password 'excito')
--- admin/views/default/stat/stat_view.php.orig  2010-11-06 18:51:02.000000000 +0100
apt-get update
+++ admin/views/default/stat/stat_view.php  2010-11-06 18:47:17.000000000 +0100
apt-get install hddtemp
@@ -17,6 +17,7 @@
apt-get install patch
&lt;table class="ui-table-outline" id="ui-stat-list"&gt;
cd /usr/share/web-admin/
&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;
wget download.excito.net/software/gui_hdd.patch
&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;
patch --verbose -p0 &lt; /usr/share/web-admin/gui_hdd.patch</pre>  
+            &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;
<br>  
&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')." "); ?&gt;
&lt;? printf("%02d",$uptime[1])?&gt;:&lt;? printf("%02d",$uptime[2])?&gt;:&lt;? printf("%02d",$uptime[3])?&gt;</pre>
<br>The result:


<br>
The result:
 
[[Image:Gui patch.jpeg]]<br>
 
<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>

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!