[rrd-users] Returning nan values

Emily Chouinard cousin17 at msu.edu
Thu Jun 19 19:36:55 CEST 2008


So I've got my code all done but my update function doesn't work. I want 
to take the values from the /proc/stat file and update my rrd with them 
but when I do an rrdtool fetch cpu.rrd AVERAGE and several interations I 
get:
 fetch cpu.rrd AVERAGE
                           user                nice                 
sys               idle

1213810500: nan nan nan nan
1213810800: nan nan nan nan
1213811100: nan nan nan nan

(but that is just a small glip of all the nan values I get) I was 
wondering if my update function was correct, my rrd is created properly 
using
rrdtool.create('cpu.rrd',
     'DS:user:DERIVE:30:0:U',
     'DS:nice:DERIVE:30:0:U',
     'DS:sys:DERIVE:30:0:U',
     'DS:idle:DERIVE:30:0:U',
     'RRA:AVERAGE:0.5:1:576',
     'RRA:AVERAGE:0.5:6:672',
     'RRA:AVERAGE:0.5:24:732',
     'RRA:AVERAGE:0.5:144:1460')

and then I run a loop to extract the data from a file
 infile= open('/proc/stat', 'r')
    #for x in range(0,1):
    line = infile.readline()
    if line.startswith('cpu'):
    info = line.split()   
    user = info[1]
    nice = info[2]    
    sys = info[3]
    idle = info[4]
and then I try to update these values from user, nice sys and idle into 
my rrd with
rrdtool.update('cpu.rrd','N:+user+:+nice+:+sys+:+idle+')

but it only gives my nan values, any suggestions on why this is?



More information about the rrd-users mailing list