Skip to content →

hddtemp + bash + mysql

So I got into this kick with gathering data and graphing it, I have been playing with flot for a bit and wanted to see what else I could graph.
I run hddtemp on my fileserver and while living in Vegas it gets pretty hot out, and my AC kicks on and off all day. I decided there has got to be a way for me to database the temp change on my hard drives through the

day and make it look nice. I put together this simple bash script that writes to the local MySQL server, then once I finish the web interface I will be making use of flot to graph the data. I thought I would share the simple script in case anyone else is interested in this as well.

As you can see the script is very simple. For your usage you might need to change the date format to suite your needs but for my instance it works great. The temp is cut so it will only display the 3 digit temp, in fahrenheit.

Published in Code Technology

%d bloggers like this: