OK, here we go
First of all you have to get the temperature information from your NAS. In a telnet session you can give this command:
/usr/syno/bin/smartctl -d sat -T permissive -l scttempsts /dev/sda
That will give this information:
smartctl 5.42 2011-10-20 r3458 [armv5tel-linux-2.6.32.12] (local build) Copyright (C) 2002-11 by Bruce Allen,
http://smartmontools.sourceforge.net
Unable to get testing progress of /dev/sda
=== START OF READ SMART DATA SECTION ===
SCT Status Version: 3
SCT Version (vendor specific): 522 (0x020a)
SCT Support Level: 1
Device State: Active (0)
Current Temperature: 34 Celsius
Power Cycle Min/Max Temperature: 14/41 Celsius
Lifetime Min/Max Temperature: 14/41 Celsius
With a cronjob we can automate this and save the info in a file. To make and edit cronjobs 'WizJos' wrote a perfect script. To run this script in DSM first instal 'Init_3rd_party.spk' You can find that on his site:
http://wizjos.endofinternet.net/synolog ... it3rdparty
After installing and running init_3rd_party you can instal the cronjobscript:
http://wizjos.endofinternet.net/synolog ... s/cronjobs
Oddly since DSM 4.0 this script runs only through your
external IP.
In Cronjobs create a new job with this command:
/usr/syno/bin/smartctl -d sat -T permissive -l scttempsts /dev/sda> /volume1/....../servertemp.txt
Make sure you complete the path to the directory of your choice.
Complete the job with a user, discription and a time interval for this job.
Now we have to put this information on a webpage. I use this simple php script:
<?php>
//Open file on the location where cronjob put it
$a = fopen("/...../servertemp.txt","r");
$b = file("/...../servertemp.txt");
$numbers = count($b);
//read the lines in the file
for ($i=0;$i<10;$i++)
{
//print("$b[$i]<br>");
//remove the slashes above for output of all info
}
//read temperature in line 9, 11the pos of the right, two digits
$temp = substr($b[9], -11, 2);
//print temperature on screen
echo "Temperature of MySynology NAS: $temp° C.";
//close file
fclose($a);
?>
Have fun with it!
The same principle I use for WunderGround API requests, so you'll never have more then 500 (free) request a day. No mather how much visitors of your site visit a page with an API request, your cron makes the request by interval. Also a page with (now a internal) API request will load 25 times faster then a direct request from your page to WunderGround.