[rrd-users] Time stamp on graphs

Alceu R. de Freitas Jr. glasswalk3r at yahoo.com.br
Thu Oct 8 16:51:46 CEST 2015


There are specific commands to be used on a Unix shell. You will have to adapt/convert those commands to Powershell.
The date commands provides a date in the specific format. Just to give you some more information (form the data manpage):
FORMAT controls the output.  Interpreted sequences are:%F     full date; same as %Y-%m-%d%T     time; same as %H:%M:%S

sed is replacing the text ":" with "\:", probably to escape the character. Maybe you won't need to do that if your Date object on Powershell does the right thing you need.
 
      De: Devante Vargas <devantev at gmail.com>
 Para: "rrd-users at lists.oetiker.ch rrdtool" <rrd-users at lists.oetiker.ch> 
 Enviadas: Quinta-feira, 8 de Outubro de 2015 11:21
 Assunto: [rrd-users] Time stamp on graphs
   
Hello,
I am trying to add timestamps to my graphs. I use a scheduled PowerShell script to execute the rrdtool to generate the graphs. I typically do it in the format of:
$CMD = "C:\path\to\rrdtool.exe" $arg1 = "graph" $arg2 = "graph.png" $arg3 = "--title"$arg4 = "Graph title" $arg5 = "--width" $arg6 = "400"$arg7 = "--vertical-label" $arg8 = "Percentage" $arg9 = "--rigid" $arg10 = "DEF:sload=rrdfile.rrd:load:LAST" $arg11 = "DEF:sservers=rrdfile.rrd:servers:LAST" $arg12 = "DEF:balanced=rrdfile.rrd:lbo:LAST" $arg13 = "GPRINT:sservers:LAST:%4.lf\j"

& $CMD $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7 $arg8 $arg9 $arg10 $arg11 $arg12 $arg13

I googled around and found someone adding "Date\: $(date "+%F %T" | sed 's/:/\\:/g')\r" but not sure how this would get added in the context above.
Any suggestions?
Thanks,
Devante
 
_______________________________________________
rrd-users mailing list
rrd-users at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20151008/79142fdb/attachment.html>


More information about the rrd-users mailing list