[rrd-users] Gauge understanding problem or error ?

Christian Volkmann CVolkmann at orga-systems.com
Thu Aug 18 12:26:35 MEST 2005


Hi to everybody,

I am trying to use the "GAUGE" e.g. for a temperature measurement.

I get the values in a 60 second rate: ( sample )
12:34:20 20
12:35:20 30
12:36:20 40
12:37:20 30
12:38:20 20
12:39:20 0
12:40:20 0
12:41:20 80
12:42:20 0
12:43:20 20

I expected a proper diagram if I use a rrd with
60 seconds step and GAUGE and "MAX" or "LAST"

What I get is
Step CF  Result
60  MAX  => expect error ? average value shown ?
60  LAST => expect error ? average value shown ?
20  MAX  => expect "shorter" duration of value "80"
20  LAST => looks OK for me

See the script below to reproduce. I have tried 1.2.11 and 1.0.49

Is there any explanation why "GAUGE" with "MAX" or "LAST" does
not work as I expect ?

Best regards,

Christian

=================================
cv at atwork:/home/rrd-test/test> cat strange
#!/bin/bash

act()
{
        STEP=$1
        CF=$2
        NAME=$3
        HEADLINE="$4"
        START=1100000060
        END=1100000660

        let DBSTART=$START-$STEP
        let TORECORD="($END-$START)/$STEP+2"

        HELPTXT=.help.txt
        export HELPTXT
        rm $HELPTXT 2>/dev/null

        rrdtool create ${NAME}test.rrd --start $DBSTART -s $STEP \
        DS:WERT:GAUGE:60:0:100 \
        RRA:$CF:0:1:$TORECORD
        cat <<EOP | while read line
        1100000060:20
        1100000120:30
        1100000180:40
        1100000240:30
        1100000300:20
        1100000360:0
        1100000420:0
        1100000480:80
        1100000540:0
        1100000600:20
EOP
        do
                rrdtool update ${NAME}test.rrd $line
                mytime=${line%:*}
                value=${line##*:}
                echo -e "`date -d \"1970-01-01 UTC $mytime seconds\" '+%H\\:%M\\:%S'` $value, \c" >> $HELPTXT
        done
        #rrdtool dump ${NAME}test.rrd
        #set -x
        rrdtool graph ${NAME}test.gif -t "Step: $STEP CF: $CF ${HEADLINE}" --start $START --end $END --step 60 -w 1024 -h 400 \
                DEF:wert=${NAME}test.rrd:WERT:$CF \
                CDEF:anzeige=wert \
                "LINE1:anzeige#00FF00:`cat $HELPTXT`"
        #set +x
        if [ -r ${NAME}test.gif ]
        then
                display ${NAME}test.gif
        fi
}

act 60 MAX "notok" " GAUGE, Not OK ? Average value shown ?"
act 60 LAST "notok" " GAUGE, Not OK ? Average value shown ?"
act 20 MAX "ok" " GAUGE, Not OK ? Value 80 shown with a too long duration ?"
act 20 LAST "ok" " GAUGE, OK, expected result"

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list