I have a Python script that updates an rrd file with data it pulls from a database. Here is a snippet of the Python code
Expand|Select|Wrap|Line Numbers
- for i in range(numrowed):
- row = curred.fetchone()
- time_stamp = row[0]
- rx_max = row[1]
- ret = rrdtool.update(ds_file.rrd,'%s:%s' %(time_stamp,rx_max));
- if ret:
- print rrdtool.error()
- i = i + 1
Traceback (most recent call last):
File "rrdfile_update.py", line 40, in <module>
ret = rrdtool.update(ds_file.rrd,'%s:%s' %(time_stamp,rx_max));
rrdtool.error: ds_file: illegal attempt to update using time 1363358441 when last update time is 1363358441 (minimum one second step)
I will appreciate very much if you can help me with a Python try catch statement to help skip this error and continue to update the rrd file with the next timestamp and value so the script does not stop.
Help very much appreciated. Thanks