With inspiration from lcd_tool and lcdmond on 419P I thought I’d make a little script that shows the hard drive temperatures on the display on a Qnap NAS (in this case a 419p):
So, lets go to the home directory and create a file called ‘showonlcd.sh’:
cd /home
nano showonlcd.sh
Then enter the following into the file:
hdd1temp=`/sbin/get_hd_temp 1`
hdd2temp=`/sbin/get_hd_temp 2`
hdd3temp=`/sbin/get_hd_temp 3`
hdd4temp=`/sbin/get_hd_temp 4`
lcd_tool -1 "HDD1 $hdd1temp HDD2 $hdd2temp" -2 "HDD3 $hdd3temp HDD4 $hdd4temp"
To save the file in nano press [ctrl] + [o] and to exit nano press [ctrl] + [x].
Make the file executable:
chmod +x showonlcd.sh
Now we need to stop the LCD manager (as described in the link above):
/sbin/daemon_mgr lcdmond stop /sbin/lcdmond
And now we can run the script and enjoy seeing the individual hard drives temperature on the LCD:
./showonlcd.sh
Thankyou for the script, however this will only return the HDD temperatures at the time you execute it misleading the user into thinking this is the current drive temperature.
Perhaps a cron-job to refresh the display every 10 minutes?
Indeed! The setup of cronjobs on Qnap NAS’ are described here: QNap – Add items to crontab