Based on this topic
I created a template to graph the RPi SoC temperature.
First of all
and put inside
Code
/**
* Sensors plugin for system information.
*/
// require("js/omv/NavigationPanel.js")
// require("js/omv/PluginMgr.js")
// require("js/omv/data/DataProxy.js")
// require("js/omv/data/Store.js")
// require("js/omv/grid/TBarGridPanel.js")
// require("js/omv/RrdGraphPanel.js")
Ext.ns("OMV.Module.Diagnostics.SysInfo");
/**
* @class OMV.Module.Diagnostics.SysInfo.Temperatures
* @derived Ext.TabPanel
*/
OMV.Module.Diagnostics.SysInfo.Temperature = function(config) {
var initialConfig = {
title: "CPU temperature",
rrdGraphName: "sensors"
};
Ext.apply(initialConfig, config);
OMV.Module.Diagnostics.SysInfo.Temperature.superclass.constructor.call(
this, initialConfig);
};
Ext.extend(OMV.Module.Diagnostics.SysInfo.Temperature, OMV.RrdGraphPanel, {
});
OMV.preg("sysinfo", "system", OMV.Module.Diagnostics.SysInfo.Temperature);
Alles anzeigen
Then you have to create another file to get your changes in to collectd.conf and omv-mkgraph:
and put inside
Bash
#!/bin/sh
set -e
. /etc/default/openmediavault
. /usr/share/openmediavault/scripts/helper-functions
OMV_COLLECTD_CONFIG=${OMV_COLLECTD_CONFIG:-"/etc/collectd/collectd.conf"}
OMV_COLLECTD_RRDTOOL_MKGRAPH=${OMV_COLLECTD_RRDTOOL_MKGRAPH:-"/usr/sbin/omv-mkgraph"}
cat <<EOF >> ${OMV_COLLECTD_CONFIG}
LoadPlugin sensors
EOF
cat <<EOF >> ${OMV_COLLECTD_RRDTOOL_MKGRAPH}
# Read temperature from sensor
tempread=\`cat /sys/class/thermal/thermal_zone0/temp\`
tempread=\$((\$tempread/1000))
value=\`echo \$tempread | cut -c -4\`
# Update database
rrdtool update \${DATA}/database.rrd N:\$value
# Create graphs
rrdtool graph \${IMGDIR}/sensors-hour.png --start \${HOURSTART} \${DEFAULTS} --title "Temperature\${HOURTITLE}" --slope-mode --upper-limit 80 --lower-limit 0 --units-exponent 0 DEF:cpumin=\${DATA}/database.rrd:value:MIN DEF:cpuavg=\${DATA}/database.rrd:value:AVERAGE DEF:cpumax=\${DATA}/database.rrd:value:MAX LINE1:cpuavg#0000FF:"SoC" GPRINT:cpumin:MIN:"%4.2lf Min" GPRINT:cpuavg:AVERAGE:"%4.2lf Avg" GPRINT:cpumax:MAX:"%4.2lf Max" GPRINT:cpuavg:LAST:"%4.2lf Last [DEG C]\l" COMMENT:"\${LASTUPDATE}" >/dev/null
rrdtool graph \${IMGDIR}/sensors-day.png --start \${DAYSTART} \${DEFAULTS} --title "Temperature\${DAYTITLE}" --slope-mode --upper-limit 80 --lower-limit 0 --units-exponent 0 DEF:cpumin=\${DATA}/database.rrd:value:MIN DEF:cpuavg=\${DATA}/database.rrd:value:AVERAGE DEF:cpumax=\${DATA}/database.rrd:value:MAX LINE1:cpuavg#0000FF:"SoC" GPRINT:cpumin:MIN:"%4.2lf Min" GPRINT:cpuavg:AVERAGE:"%4.2lf Avg" GPRINT:cpumax:MAX:"%4.2lf Max" GPRINT:cpuavg:LAST:"%4.2lf Last [DEG C]\l" COMMENT:"\${LASTUPDATE}" >/dev/null
rrdtool graph \${IMGDIR}/sensors-week.png --start \${WEEKSTART} \${DEFAULTS} --title "Temperature\${WEEKTITLE}" --slope-mode --upper-limit 80 --lower-limit 0 --units-exponent 0 DEF:cpumin=\${DATA}/database.rrd:value:MIN DEF:cpuavg=\${DATA}/database.rrd:value:AVERAGE DEF:cpumax=\${DATA}/database.rrd:value:MAX LINE1:cpuavg#0000FF:"SoC" GPRINT:cpumin:MIN:"%4.2lf Min" GPRINT:cpuavg:AVERAGE:"%4.2lf Avg" GPRINT:cpumax:MAX:"%4.2lf Max" GPRINT:cpuavg:LAST:"%4.2lf Last [DEG C]\l" COMMENT:"\${LASTUPDATE}" >/dev/null
rrdtool graph \${IMGDIR}/sensors-month.png --start \${MONTHSTART} \${DEFAULTS} --title "Temperature\${MONTHTITLE}" --slope-mode --upper-limit 80 --lower-limit 0 --units-exponent 0 DEF:cpumin=\${DATA}/database.rrd:value:MIN DEF:cpuavg=\${DATA}/database.rrd:value:AVERAGE DEF:cpumax=\${DATA}/database.rrd:value:MAX LINE1:cpuavg#0000FF:"SoC" GPRINT:cpumin:MIN:"%4.2lf Min" GPRINT:cpuavg:AVERAGE:"%4.2lf Avg" GPRINT:cpumax:MAX:"%4.2lf Max" GPRINT:cpuavg:LAST:"%4.2lf Last [DEG C]\l" COMMENT:"\${LASTUPDATE}" >/dev/null
rrdtool graph \${IMGDIR}/sensors-year.png --start \${YEARSTART} \${DEFAULTS} --title "Temperature\${YEARTITLE}" --slope-mode --upper-limit 80 --lower-limit 0 --units-exponent 0 DEF:cpumin=\${DATA}/database.rrd:value:MIN DEF:cpuavg=\${DATA}/database.rrd:value:AVERAGE DEF:cpumax=\${DATA}/database.rrd:value:MAX LINE1:cpuavg#0000FF:"SoC" GPRINT:cpumin:MIN:"%4.2lf Min" GPRINT:cpuavg:AVERAGE:"%4.2lf Avg" GPRINT:cpumax:MAX:"%4.2lf Max" GPRINT:cpuavg:LAST:"%4.2lf Last [DEG C]\l" COMMENT:"\${LASTUPDATE}" >/dev/null
#0000FF means blue trace color in the graphs.
EOF
Alles anzeigen
Then you have to create the temperature database
and put inside
Bash
#!/bin/bash
rrdtool create database.rrd --start N --step 300 \
DS:value:GAUGE:600:U:U \
RRA:AVERAGE:0.5:1:12 \
RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:12:168 \
RRA:AVERAGE:0.5:12:720 \
RRA:AVERAGE:0.5:288:365 \
RRA:MIN:0.5:1:12 \
RRA:MIN:0.5:1:288 \
RRA:MIN:0.5:12:168 \
RRA:MIN:0.5:12:720 \
RRA:MIN:0.5:288:365 \
RRA:MAX:0.5:1:12 \
RRA:MAX:0.5:1:288 \
RRA:MAX:0.5:12:168 \
RRA:MAX:0.5:12:720 \
RRA:MAX:0.5:288:365
Alles anzeigen
Afterwards you have to make it executable
and then run it
. This should create a file inside the folder named database.rrd. which will store all the temp data. After that, log in the webgui, go to the System information-> System->Temperature tab. After some minutes you should get you SoC temp
The next step is to graph also the CPU freq parallel to the temp graph (for those who overclocked the SoC)