[rrd-users] Unable to print VDEF value timestamp

A Darren Dunham ddunham at taos.com
Mon Mar 16 18:21:08 CET 2009


On Sat, Mar 14, 2009 at 01:08:42PM +0100, Marco Chiappero wrote:
> Hi,
> 
> I'm fighting a little bit with the ":strftime" function, it doesn't seem 
> to work here.
> For example
> 
>    GPRINT:current_uptime:"%lg secs":"%V"
> 
> returns
> 
>    ERROR: I don't understand ':%V' in command: 
> 'GPRINT:current_uptime:%lg secs:%V'
> 
> What's wrong with that? Is there something I'm missing?

First, the documentation shows that strftime is an option on PRINT, but
I don't see it available on GPRINT.  On my 1.2.23 setup, it works in one
way, but it breaks other things.

Second, strftime is an actual string (note it is not italicized in the
HTML documentation).  It just lets you use the strftime formats in your
"format" section.

    PRINT:current_uptime:"%lg secs %V":strftime

Should be a working example.  Without the :strftime, the %V won't expand
properly. 

> I'm using version 1.3.1 from debian repositories.

Maybe GPRINT will work better in that version.  In my version, adding
:strftime to that function allows strftime formats to work, but it
breaks the normal ones.  This doesn't happen with PRINT.

  GPRINT:KB:AVERAGE:"Avg %lf"              =>  Avg 28
  GPRINT:KB:AVERAGE:"Avg %lf %Y"           =>  bad format for GPRINT
  GPRINT:KB:AVERAGE:"Avg %lf %Y:strftime"  =>  Avg %lf 2009

-- 
Darren



More information about the rrd-users mailing list