Core Temperatures Widget
-
First of all the Credits (places where i got a few ideas from):
Temperature Widget
http://forum.pfsense.org/index.php/topic,49635.0.htmlHow to: Get CPU temp
http://forum.pfsense.org/index.php/topic,39595.0.htmlHOWTO: Temperature Monitoring with coretemp in Sysinfo widget
http://forum.pfsense.org/index.php/topic,52301.0.htmlPure CSS/HTML Bullet Graph
http://www.usrecordings.com/test-lab/bullet-graph.htmand some other threads on pfSense forum, great community, thank you ALL!
Description:
Core Temperatures widget is a stand-alone widget.
No existing/original file changes required (accept loader.conf.local).
Displays temperature data for anything returned by "sysctl -a | grep temperature" command.
Configurable thresholds and display appearance.Designed and tested on:
pfSense v2.0.2-RELEASE (i386)
FF, Chrome and IE9 (no config in IE due to some other webGUI issue).
Hardware: Intel DH77EB, Core i3 3225
Setup steps:
1. Download appropriate coretemp.ko for your system (32bit or 64bit)
for 32bit: http://files.pfsense.org/jimp/ko-8.1/i386/coretemp.ko
for 64bit: http://files.pfsense.org/jimp/ko-8.1/amd64/coretemp.ko2. Copy the above downloaded appropriate (32 or 64) coretemp.ko file into "/boot/modules/". (I use WinSCP to copy it over)
3. Edit "/boot/loader.conf.local" file and add the following line at the end:
coretemp_load="YES"
4. open a shell (or Command Prompt in webGUI) and execute the following command:
kldload coretemp
5. At this point executing this command "sysctl -a | grep temperature" (no quotes) should output something like this:
hw.acpi.thermal.tz0.temperature: 27.8C
hw.acpi.thermal.tz1.temperature: 29.8C
dev.cpu.0.temperature: 31.0C
dev.cpu.1.temperature: 31.0C
dev.cpu.2.temperature: 34.0C
dev.cpu.3.temperature: 34.0C6. Download and extract "coretemp_widget.zip" file from here:
https://docs.google.com/file/d/0Bw9oO7PUP_kPdHYzMUZDVjk1Tmc/edit?usp=sharing7. Copy the following 2 files to "/usr/local/www/widgets/include/"
coretemp_widget.inc
coretemp_widget.php8. Copy the follwing file to "/usr/local/www/widgets/javascript/"
coretemp_widget.js9. Copy the follwing file to "/usr/local/www/widgets/widgets/"
coretemp_widget.widget.php10. Go to Dashboard and hit Ctrl+F5 just in case
11. You should now see "Core Temperatures" in Available Widgets, just add it.
The end result should look something like this (see attached img):
The configuration for the widget is mostly self-explanatory, but let me know if you have any questions on it.
NOTE: config doesn't work in IE (at least not on my box with pfSense v2.0.2), so please use a normal browser :)
Hopefully somebody find it useful.
I would appreciate any comments or suggestions to make it better, critique is fine too :)
P.S. this version is based on Prototype/Scriptaculous js libs, the jQuery version is available (just a few changes), but i cannot fully test it yet until next pfSense release…
-
That looks interesting, I recently did a widget for Dynamic DNS and got the suggestions (and some help) from the posts here:
http://forum.pfsense.org/index.php/topic,58278.msg312391.html#msg312391
I'd never dealt with Git before but I ended up with my Widget in the pfSense Git and accepted into the project's code.
-
Puslate a typo? Pulsate.
-
@onhel:
Puslate a typo? Pulsate.
D'oh! Corrected. File and link are updated.
Thank you onhel.
-
That looks interesting, I recently did a widget for Dynamic DNS and got the suggestions (and some help) from the posts here:
http://forum.pfsense.org/index.php/topic,58278.msg312391.html#msg312391
I'd never dealt with Git before but I ended up with my Widget in the pfSense Git and accepted into the project's code.
Thank you Stan for good points.
Never dealt with Git ether. I'll play with it this weekend, see if I can fork and put these files in.Just need first to understand Git better and figure out which version, branch or tag I need to fork for pfSense v2.0.2 (for current widget) as well as jQuery version for pfSense v2.1…
I would really appreciate any guidance on proper forking.
-
These links might help too:
http://devwiki.pfsense.org/GitWorkflow
http://devwiki.pfsense.org/GitInfo
http://devwiki.pfsense.org/GitLinks
-
thanks again Stan!
-
New features always have to go into the master branch first, which is 2.1 right now. We can't accept any new features into 2.0.x since it's just a bug fix/maintenance release branch now.
There are some differences between 2.0.2 and 2.1 in the UI code for the dashboard/widgets, mostly that it's using jquery instead of prototype.
Also on 2.1 the coretemp and amdtemp modules are built in and selectable in the GUI under System > Advanced on the Misc tab, so it's even easier to use. The temperature is also displayed in the system information widget but it only checks/reports on one core.
-
Thank you Jim.
Yep, no new features for 2.0.1 (learned it the hard way :-[).I have jQuery version of the widget ready, but still would like to test it on 2.1 before pushing it.
I've managed to temporary plug-in jQuery on my 2.0.1 box and test it that way, but this is not a 100% test.
Trying to figure out now how to install latest 2.1 snapshot on VM on my Vista box (hopefully it is possible somehow) to do a final test.
You have mentioned that the coretemp/amdtemp modules are built-in now, could you please clarify the following (in case i'm not successful with VM):
1. are any of them set by default (on install), or user has to explicitly select one to turn it on?
2. what would be the best way to programmatically (PHP, I'd assume) determine if module is turned on?Thanks in advance.
-
1. None by default. User has to select.
2. There is an is_module_loaded() function you can use. Check util.inc. e.g. is_module_loaded("coretemp.ko") -
Perfect!
Just checked the code and the description on System > Advanced > Misc mentions that if module is not installed it will try to read from ACPI.
Can I assume that "sysctl -a | grep temperature" command would return at least one zone sensor (like "hw.acpi.thermal.tz0.temperature") even if none of the modules turned on/installed (assuming it is ACPI-compliant motherboard)?
-
Not sure off the top of my head what all the sysctls are. Check /usr/local/www/includes/functions.inc (or thereabouts) and look at get_temp();
-
thanks Jim,
looks like it was a moot-point question on my part.even if "sysctl -a | grep temperature" returns nothing, we can just put a msg and point user to Misc page (with a direct link).
some thing like this (see last snapshot), would that be appropriate?