I’m trying to keep track of the CPU temperature and usage and then create a graph with the values. I used the rrdtool to store and create the graph. Here is the command I used to create:
rrdtool create "$temp_db" --step 10 DS:temp:GAUGE:30:0:200 DS:cpu:GAUGE:30:0:100 RRA:MAX:0.5:1:10080
then to insert values:
rrdtool update "$temp_db" --template temp:cpu N:"$cpuTemp":"$one"
if I query the data, it looks like this:
1501092070: 5.5000000000e+01 1.3890166000e-01 1501092080: 5.5571964700e+01 2.8151435200e-01 1501092090: 5.5571964700e+01 2.8151435200e-01 1501092100: 5.6000000000e+01 3.2340902500e-01 1501092110: 5.5471508500e+01 2.7357542500e-01 1501092120: 5.5000000000e+01 2.7103286800e-01
To create the graph I use this:
rrdtool graph cpu.png --slope-mode --full-size-mode --right-axis 1:0 --x-grid MINUTE:1:MINUTE:10:MINUTE:10:0:%a/%H --width 900 --height 400 -s 'now - 1 hours' -e 'now' DEF:TEMP=$temp_db:temp:MAX DEF:CPU=$temp_db:cpu:MAX LINE1:TEMP#0000FF:CPU_Temperature LINE2:CPU#FF0000:CPU_Usage
The temperature line (temp) is showed corectly, but the the CPU usage (cpu) stays at 0. Here is how the graph looks like:
Can someone please tell me what I’m doing wrong?
Advertisement
Answer
oops, just realized that in my data one column is e+01
and the other e-01