Blame tests/p_rrdtool/rrdtool_test.sh

Christoph Galuschka 26fe2d
#!/bin/sh
Christoph Galuschka 26fe2d
# Author: Athmane Madjoudj <athmanem@gmail.com>
Christoph Galuschka dae1aa
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka 26fe2d
# RRD-sample from http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html
Christoph Galuschka 26fe2d
Masami Ichikawa e9f6c2
if [ $centos_ver -ge 6 ]
Athmane Madjoudj a7b59b
then
Christoph Galuschka dcd6e0
    t_Log "Running $0 - rrdtool: create rrd, write values and retrieve values test."
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    # creating test RRD
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    FILE="/var/tmp/temperature.rrd"
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    rrdtool create $FILE --step 1 DS:temp:GAUGE:600:-273:5000 RRA:AVERAGE:0.5:1:1200
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    # insert value
Athmane Madjoudj 9b87af
    rrdtool update $FILE N:30
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    # retrieve value and check
Athmane Madjoudj 9b87af
    WORKING=$(rrdtool fetch $FILE AVERAGE -s -80 |grep -c '3.0000000000e+01')
Athmane Madjoudj 9b87af
Athmane Madjoudj 9b87af
    # if $WORKING > 0 -> update and retrieval works
Athmane Madjoudj 9b87af
    if [ $WORKING > 0 ]; then ret_val=0;
Athmane Madjoudj 9b87af
    fi
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    #remove RRD-File
Athmane Madjoudj 9b87af
    /bin/rm $FILE
Christoph Galuschka 26fe2d
Athmane Madjoudj 9b87af
    t_CheckExitStatus $ret_val
Athmane Madjoudj 9b87af
else
Athmane Madjoudj 9b87af
    echo "Skipped on CentOS 5"
Athmane Madjoudj 9b87af
fi