[rrd-users] Re: Changing week to date

Lozovsky, Daniel daniel.lozovsky at attws.com
Mon Mar 8 06:09:09 MET 2004


Jason,

What do you mean not entering the data exactly at the right time.

The first set of numbers come in correctly, the last one always comes in
as a decimal.  I can not figure out what is going on. 

The numbers that I am entering all come from the following script:

#!/bin/sh
#
# version 1.05
#
#
# set -x

##################################
# Start of script
##################################

if test ! "$BBHOME"
then
        echo "$0: BBHOME is not set"
        exit 1
fi

if test ! "$BBRRDS"
then
	echo "$0: BBRRDS is not set"
        exit 1
fi

if test ! -d "$BBHOME"
then
        echo "$0: BBHOME is invalid"
        exit 1
fi

##
# real work begins here
##

# go to the logs area for simplication of the list
BBLOGS="/export/home/bbuser/bbvar/logs"
cd /export/home/bbuser/bbvar/logs

# go to the logs area and see what data we can gather
BOX="atprap01.connect atprap02.connect atprap03.connect"
for log in `echo $BOX`
do
	# you need three things to collect data
        TS=N
	# getting RRD
        HOST=`echo $log | cut -d. -f1 `

        cat $log | grep Total | awk '{print $4}' | while read number
        do 
           # echo $n $VALUE
	   RRD=$BBRRDS/$HOST.connect.rrd

        x1=0
        x2=0

	# if it doesn't exist, make it 
	if [ ! -f $RRD ]
	then
		# $RRAS is defined in larrd.conf
              $RRDTOOL create $RRD DS:number:GAUGE:600:0:U
DS:x1:GAUGE:600:0:U DS:x2:GAUGE:600:0:U $RRAS


		if [ $STATUS -eq "1" ]
		then
			echo "$0: STATUS  did not find $RRD, created."
		fi
         TS=N
	 fi

	# RRD acquisition co>plete, proceed to TS	

	TS=N
	 

	# Data acquired to do the job

	if [ $DEBUG -eq 1 ]
	then
		echo "$0: DEBUG $RRDTOOL update $RRD $TS:$VALUE"
	fi
	 $RRDTOOL update $RRD $TS:$number:$x1:$x2 sleep 1
       
done
done



##############################################
# end of script
##############################################




-----Original Message-----
From: Jason Koon [mailto:jakoon at kraquen.com] 
Sent: Sunday, March 07, 2004 7:26 PM
To: Lozovsky, Daniel
Subject: Re: [rrd-users] Re: Changing week to date

while i dont know all of the details, i would assume your problem with
the #'s going in as decimal has to do with the normalization of the data
because you are not entering the data exactly at the right time
Lozovsky, Daniel wrote:

>I do not know why I am getting decimal number in my rrd database when 
>the numbers should be whole numbers.  I ran the script by echoing the 
>rrdupdate command on the scean and the numbers come in as whole, 
>however looking at the graphs the numbers apear as decimals.
>
>Is there a way I can fix this?
>
>  
>

--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list