[rrd-users] Ruby bindings and

Troex Nevelin list at mrtech.ru
Tue Jul 26 23:51:15 CEST 2011


Hello,

I'm using ruby bindings to xport data from Munin RRDs inside rails app.
Everything works fine until I get first error during RRD.xport. For example
rrd file is missing, or my DEF/CDEF are in wrong format - I get an Exception
- everything is okay this behaviour is correct, but when I run RRD.xport 
again
with correct options inside same rails app (without restarting it) I always
get the same first Exception, so if my script reads 20 rrds and I got error
on 5th than the last 15 RRD will return the same error as 5th. I can get rid
of that Exception only if I restart my Rails app.

How can I flush this error from RRD library without restarting?

I've looked through bindings/ruby/main.c ... maybe `reset_rrd_state();`
should be used in `rb_rrd_xport` method as well? (I'm not familiar with C)


-- 
opts = [
   '--start', start,
   '--end',   end,
   '--step',  step
]
opts.push('DEF:%s=%s:42:AVERAGE' % [src, rrdfile])
opts.push('CDEF:%s_c=%s' % [src, cdef]) if cdef
opts.push('XPORT:%s%s:comment' % [src, (cdef ? '_c': '')])

(fstart, fend, fstep, col, legend, data) = RRD.xport(*opts)



More information about the rrd-users mailing list