[rrd-users] rrdtool graph confusion

Yiannis Vavouranakis yiannis at vavouranakis.gr
Tue Jul 1 22:03:10 CEST 2008


> 2nd I'm trying to comment the current date at the bottom of my graph but 
> am so far unsuccessful. I've tried  COMMENT:"%m/%d/%Y %H\:%M\:%S",  and 
> I tried declaring cur_date = '%m/%d/%Y %H\:%M\:%S' and then commenting 
> cur_date COMMENT:"' + cur_date + '" and neither are working for me.  I 
> get the following error:
>
>  Traceback (most recent call last):
>   File "cpu_usage.py", line 78, in ?
>  ' COMMENT:"' + cur_date + '"')
> rrdtool.error: Could not make sense out of ' COMMENT:"%m/%d/%Y
%H\:%M\:%S"'
>
> I'm probably missing something very basic (oh and I'm using python so 
> thats why everything is being passed as a string)

Actually, I figured out what you're trying to do here. My guess is that the
COMMENT does not understand sequences like %m/%d/%Y. Try the following:
instead of saying cur_date = '%m/%d/%Y %H\:%M\:%S', declare cur_date as a
datetime object, then use an appropriate string representation of it to
concatenate with COMMENT. 

Hope it helps.

Regards,
Yiannis Vavouranakis



More information about the rrd-users mailing list