Showing posts with label pfSense. Show all posts
Showing posts with label pfSense. Show all posts

Sunday, March 10, 2013

Adding CPU Temperature Monitoring to pfSense

One thing that I noticed after installing pfSense 2.0.2-RELEASE was that temperature was conspicuously absent from the Dashboard System Information widget.  Since the pfSense widgets are built using PHP, I figured it wouldn't be too hard to add the required functionality.  The first step was figuring out how to read the CPU temperatures.  My pfSense setup is a repurposed 2.4 GHz Pentium 4 computer w/ 1 GB memory I built circa 2003.  Pretty ancient.

FreeBSD provides modules for reading motherboard temperatures on late model Intel (Core Duo) and AMD CPUs.  The modules can be found in /boot/kernel as coretemp.ko and amdtemp.ko respectfully.  Use kdload to install the appropriate module and sysctl to access the temperature values.

 $> kldload coretemp # amdtemp  
 $> sysctl -a | grep -i temperature  

For my motherboard I need to go a little more old school and use mbmon (MotherBoard Monitor).  pfSense does not include the mbmon package by default so we need to install it.  Unfortunately I got the following error when I tried installing mbmon: