[Eisfair] E-1 LM_Sensors/Eisgraph-Modul-Files für GA-6BXDU

Kay Martinen kay at martinen.de
So Mai 26 15:33:38 CEST 2013


Hallo @all

Ich glaube ich habe das bei mir jetzt soweit hin bekommen das ich
sinnvolle und glaubhafte Werte von lm_sensors bekomme und diese in
eisgraph auch geplottet werden. Für alle die noch rätseln hier meine;
teils noch; händischen Einstellungen für mein GigaByte GA-6BXDU und
SMP-Kernel). Das hat 3 Lüfter (CPU1&2 und Netzteil), 3 Temp.Sensoren
(CPU1&2 und Board) und 9 Spannungs-Messungen.

Base 2.0.4 und EisKernel 2.0.33 Linux-2.6.32-eisfair-1-smp
lm_sensors 1.9.91 T + eisgraph 0.0.27 U

Basierend auf...

# /etc/sensors3.conf
chip "w83782d-*"
set beep_enable 0
label fan1  "CPUFan_A"
set fan1_div 4
set fan1_min 2000
label fan2  "CPUFan_B"
set fan2_div 4
set fan2_min 2000
label fan3 "SysFan"
set fan3_div 4
set fan3_min 1000
label temp1 "System"
set temp1_max 45
set temp1_max_hyst 40
label temp2 "CPU_A"
set temp2_max 70
set temp2_max_hyst 55
label temp3 "CPU_B"
set temp3_max 70
set temp3_max_hyst 65
label in0 "Vcore A"
label in1 "Vcore B"
label in2 "+3,3 Volt"
label in3 "+5 Volt"
label in4 "+12 Volt"
label in5 "-12 Volt"
label in6 "-5 Volt"
label in7 "5 Volt SB"
label in8 "vBat"
compute in3 ((6.8/10)+1)*@ ,  @/((6.8/10)+1)
compute in4 ((28/10)+1)*@  ,  @/((28/10)+1)
compute in5 (5.14 * @) - 14.91  ,  (@ + 14.91) / 5.14
compute in6 (3.14 * @) -  7.71  ,  (@ +  7.71) / 3.14
compute in7 ((6.8/10)+1)*@ ,  @/((6.8/10)+1)
set in0_min cpu0_vid*0.95
set in0_max cpu0_vid*1.05
set in1_min cpu0_vid*0.95
set in1_max cpu0_vid*1.05
set in2_min 3.3 * 0.95
set in2_max 3.3 * 1.05
set in3_min 5.0 * 0.95
set in3_max 5.0 * 1.05
set in4_min 12 * 0.90
set in4_max 12 * 1.10
set in5_max -12 * 0.90
set in5_min -12 * 1.10
set in6_max -5 * 0.95
set in6_min -5 * 1.05
set in7_min 5 * 0.95
set in7_max 5 * 1.05
set in8_min 3.0 * 0.80
set in8_max 3.0 * 1.20

(Mit Hilfe von Marcus R. Holger B. und Detlef P. hier!)

Basierend auf einer Vorlage von Thomas Quast

* für die temperaturen lmtemp... *

/create

#!/bin/sh
#----------------------------------------------------------------------------
# /usr/local/eisgraph/create/lmtemp
#
# Copyright (c) 2008 Thomas Quast <eisfair(at)thquast.de>
#
# Creation:        2004.11.17  by tq
# Last Update:     2005.12.23  by tq
# Created by User: 2013.05.25 17:09:56
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; only version 2 of the License
#
#----------------------------------------------------------------------------

if [ ! -e $EISGRAPH_DBFILE ]
then
    mecho -warn "Creating rrd for $BASENAME ..."
    /usr/local/bin/rrdtool create $EISGRAPH_DBFILE -s $beat1 \
      DS:Temp1:GAUGE:$beat2:U:U \
      DS:Temp2:GAUGE:$beat2:U:U \
      DS:Temp3:GAUGE:$beat2:U:U \
    RRA:AVERAGE:0.5:1:180 \
    RRA:AVERAGE:0.5:1:1440 \
    RRA:AVERAGE:0.5:6:1680 \
    RRA:AVERAGE:0.5:24:1860 \
    RRA:AVERAGE:0.5:288:1855 \
    RRA:MAX:0.5:1:180 \
    RRA:MAX:0.5:1:1440 \
    RRA:MAX:0.5:6:1680 \
    RRA:MAX:0.5:24:1860 \
    RRA:MAX:0.5:288:1855 \
    RRA:MIN:0.5:1:180 \
    RRA:MIN:0.5:1:1440 \
    RRA:MIN:0.5:6:1680 \
    RRA:MIN:0.5:24:1860 \
    RRA:MIN:0.5:288:1855
fi

/collect

/usr/bin/sensors >/tmp/lm-temp.$$$

Temp1=$(awk '/System/ { print $2 }' /tmp/lm-temp.$$$)
Temp2=$(awk '/CPU_A/ { print $2 }' /tmp/lm-temp.$$$)
Temp3=$(awk '/CPU_B/ { print $2 }' /tmp/lm-temp.$$$)

rrdtool update $EISGRAPH_DBFILE N:$Temp1:$Temp2:$Temp3

rm /tmp/lm-temp.$$$

/graph

# $1 = image suffix
# $2 = period in seconds
# $3 = graph title suffix

DESTIMG=$EISGRAPH_IMGDIR/${BASENAME}_${1}.png

/usr/local/bin/rrdtool graph $DESTIMG \
    --start -$2 \
    --height $EISGRAPH_IMG_HEIGHT \
    --width $EISGRAPH_IMG_WIDTH \
    --imgformat PNG \
    --title "$title $timespan" \
    --vertical-label $vertical \
    --lazy \
    --color BACK$EISGRAPH_RRDCOLOR_BACK \
    --color CANVAS$EISGRAPH_RRDCOLOR_CANVAS \
    --color SHADEA$EISGRAPH_RRDCOLOR_SHADEA \
    --color SHADEB$EISGRAPH_RRDCOLOR_SHADEB \
    --color FONT$EISGRAPH_RRDCOLOR_FONT \
    --color AXIS$EISGRAPH_RRDCOLOR_AXIS \
    --color FRAME$EISGRAPH_RRDCOLOR_FRAME \
    --color ARROW$EISGRAPH_RRDCOLOR_ARROW \
    DEF:t1=$EISGRAPH_DBFILE:Temp1:MAX \
    DEF:t2=$EISGRAPH_DBFILE:Temp2:MAX \
    DEF:t3=$EISGRAPH_DBFILE:Temp3:MAX \
    LINE2:t1#FF0000:"System" \
    GPRINT:t1:AVERAGE:"Avg.\: %2.1lf " \
    GPRINT:t1:MAX:"Max.\: %2.1lf " \
    GPRINT:t1:MIN:"Min.\: %2.1lf " \
    GPRINT:t1:LAST:"Cur.\: %2.1lf  \n" \
    LINE2:t2#FFFF00:"CPU_A" \
    GPRINT:t2:AVERAGE:"Avg.\: %2.1lf " \
    GPRINT:t2:MAX:"Max.\: %2.1lf " \
    GPRINT:t2:MIN:"Min.\: %2.1lf " \
    GPRINT:t2:LAST:"Cur.\: %2.1lf  \n" \
    LINE2:t3#00FF00:"CPU_B" \
    GPRINT:t3:AVERAGE:"Avg.\: %2.1lf " \
    GPRINT:t3:MAX:"Max.\: %2.1lf " \
    GPRINT:t3:MIN:"Min.\: %2.1lf " \
    GPRINT:t3:LAST:"Cur.\: %2.1lf  \n" \
    COMMENT:" " > $EISGRAPH_IMGDIR/picres_$BASENAME

* Für die Lüfter lmfan *

/create

if [ ! -e $EISGRAPH_DBFILE ]
then
    mecho -warn "Creating rrd for $BASENAME ..."
    /usr/local/bin/rrdtool create $EISGRAPH_DBFILE -s $beat1 \
      DS:fan1:GAUGE:$beat2:U:U \
      DS:fan2:GAUGE:$beat2:U:U \
      DS:fan3:GAUGE:$beat2:U:U \
    RRA:AVERAGE:0.5:1:180 \
    RRA:AVERAGE:0.5:1:1440 \
    RRA:AVERAGE:0.5:6:1680 \
    RRA:AVERAGE:0.5:24:1860 \
    RRA:AVERAGE:0.5:288:1855 \
    RRA:MAX:0.5:1:180 \
    RRA:MAX:0.5:1:1440 \
    RRA:MAX:0.5:6:1680 \
    RRA:MAX:0.5:24:1860 \
    RRA:MAX:0.5:288:1855 \
    RRA:MIN:0.5:1:180 \
    RRA:MIN:0.5:1:1440 \
    RRA:MIN:0.5:6:1680 \
    RRA:MIN:0.5:24:1860 \
    RRA:MIN:0.5:288:1855
fi

/collect

/usr/bin/sensors > /tmp/lm-fan.$$$
fan1=$(awk '/SysFan/ { print $2 }' /tmp/lm-fan.$$$)
fan2=$(awk '/CPUFan_A/ { print $2 }' /tmp/lm-fan.$$$)
fan3=$(awk '/CPUFan_B/ { print $2 }' /tmp/lm-fan.$$$)

rrdtool update $EISGRAPH_DBFILE N:$fan1:$fan2:$fan3
rm /tmp/lm-fan.$$$

/graph

# $1 = image suffix
# $2 = period in seconds
# $3 = graph title suffix

DESTIMG=$EISGRAPH_IMGDIR/${BASENAME}_${1}.png

/usr/local/bin/rrdtool graph $DESTIMG \
    --start -$2 \
    --height $EISGRAPH_IMG_HEIGHT \
    --width $EISGRAPH_IMG_WIDTH \
    --imgformat PNG \
    --title "$title $timespan" \
    --vertical-label $vertical \
    --lazy \
    --color BACK$EISGRAPH_RRDCOLOR_BACK \
    --color CANVAS$EISGRAPH_RRDCOLOR_CANVAS \
    --color SHADEA$EISGRAPH_RRDCOLOR_SHADEA \
    --color SHADEB$EISGRAPH_RRDCOLOR_SHADEB \
    --color FONT$EISGRAPH_RRDCOLOR_FONT \
    --color AXIS$EISGRAPH_RRDCOLOR_AXIS \
    --color FRAME$EISGRAPH_RRDCOLOR_FRAME \
    --color ARROW$EISGRAPH_RRDCOLOR_ARROW \
    DEF:t1=$EISGRAPH_DBFILE:fan1:MAX \
    DEF:t2=$EISGRAPH_DBFILE:fan2:MAX \
    DEF:t3=$EISGRAPH_DBFILE:fan3:MAX \
    LINE2:t1#FF0000:"P/S-Fan" \
    GPRINT:t1:AVERAGE:"Avg.\: %2.1lf " \
    GPRINT:t1:MAX:"Max.\: %2.1lf " \
    GPRINT:t1:MIN:"Min.\: %2.1lf " \
    GPRINT:t1:LAST:"Cur.\: %2.1lf  \n" \
    LINE2:t2#FFFF00:"CpuFan_A" \
    GPRINT:t2:AVERAGE:"Avg.\: %2.1lf " \
    GPRINT:t2:MAX:"Max.\: %2.1lf " \
    GPRINT:t2:MIN:"Min.\: %2.1lf " \
    GPRINT:t2:LAST:"Cur.\: %2.1lf  \n" \
    LINE2:t3#00FF00:"CpuFan_B" \
    GPRINT:t3:AVERAGE:"Avg.\: %2.1lf " \
    GPRINT:t3:MAX:"Max.\: %2.1lf " \
    GPRINT:t3:MIN:"Min.\: %2.1lf " \
    GPRINT:t3:LAST:"Cur.\: %2.1lf  \n" \
    COMMENT:" " > $EISGRAPH_IMGDIR/picres_$BASENAME


Was ich bei der ganzen Sache nun nicht hinbekommen habe ist:

- wenn im collect-script auch Sensor-bezeichnungen mit Leerzeichen
auftauchen dies korrekt um zu setzen. Ich kenne mich mit awk nicht aus
und mit RegExp. ähnlich.

- alle diese teile in ein modul-script zu packen. Wenn ich dort die
tempx und fanx zeilen mit echo einfüge tauchen nur die werte als fester
eintrag auf. Lasse ich es aber weg tauchen diese zeilen auch nicht auf,
oder so das sie keine werte liefern.

Wenn hierzu jemand ein update liefern könnte dann teste ich das gern so
das man nur das modul-script über das Setup aufrufen braucht. Wenn ich
das jetzt mache ist alles wieder kaputt. Warscheinlich sind es nur
kleinigkeiten auf die ich einfach nicht komme.

Kay


Mehr Informationen über die Mailingliste Eisfair