Omnimaga

General Discussion => Technology and Development => Web Programming and Design => Topic started by: Keoni29 on July 02, 2014, 07:40:41 am

Title: HTML5 Server Temperature Graph
Post by: Keoni29 on July 02, 2014, 07:40:41 am
I wrote a script that logs the cpu temperature of my server. This is a frontend for it written in javascript. It uses the html5 canvas tag.

Dark theme(default):
http://cookiecraft.eeems.me:81/stats/sensors.php?theme=dark (http://cookiecraft.eeems.me:81/stats/sensors.php?theme=dark)

Light theme:
http://cookiecraft.eeems.me:81/stats/sensors.php?theme=light (http://cookiecraft.eeems.me:81/stats/sensors.php?theme=light)


Features:
+ Awesome solarized color palettes.
+ Graph zooms in on data.
+ Graph division scales to y-axis range.
+ Lines indicating normal and critical temperature (not seen in these images. My server is stable at the moment)
Title: Re: HTML5 Server Temperature Graph
Post by: Streetwalrus on July 02, 2014, 07:43:23 am
Now that's pretty cool ! :D
Title: Re: HTML5 Server Temperature Graph
Post by: Sorunome on July 02, 2014, 07:43:55 am
Maybe have the dark theme have a light shadow :P
Anyways, it is looking awesome! :D
Title: Re: HTML5 Server Temperature Graph
Post by: Eeems on July 02, 2014, 10:27:08 am
You should include graphs for CPU and memory usage to see if it coincides with temperatures changes.
Title: Re: HTML5 Server Temperature Graph
Post by: Streetwalrus on July 02, 2014, 11:42:27 am
Good idea Eeems. :)
Title: Re: HTML5 Server Temperature Graph
Post by: Keoni29 on July 02, 2014, 12:43:05 pm
Yeah I should, but first I am going to add labels to the x-axis (time)
Title: Re: HTML5 Server Temperature Graph
Post by: ordelore on July 02, 2014, 01:08:58 pm
So custom themes default to light? I think I know how you decide which theme to use.
Title: Re: HTML5 Server Temperature Graph
Post by: Keoni29 on July 02, 2014, 03:10:30 pm
Dark is the default when you don't specify a theme. Light is the default when you specify a theme that does not exist :P
Title: Re: HTML5 Server Temperature Graph
Post by: ordelore on July 02, 2014, 04:22:05 pm
Which is why there is no 'thegame' texture?
/me runs
Title: Re: HTML5 Server Temperature Graph
Post by: Keoni29 on July 04, 2014, 04:27:17 am
The script now captures cpu usage as well, but I have not added it to the graph yet. I should make a more detailed graph for cpu usage ,because it fluctuates more than the temperature. This implies that the datalogger script should run more often.


I added a temperature alarm that makes a sound when the cpu overheats. When it's above the critical threshold the server will automatically reboot. The alarm only sounds during the day so I don't wake up anyone. This is to make sure my dad does not throw out the server :P When a critical temperature occurs at night it will simply reboot or shut down (depends on the temperature)
Title: Re: HTML5 Server Temperature Graph
Post by: Streetwalrus on July 04, 2014, 04:30:53 am
Wow Keoni you're being very careful with your server. O.O Mine is just an RPi lying around in a corner and ignored by everyone. :P