Alceu R. de Freitas Jr.
2015-10-08 14:51:46 UTC
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 <***@gmail.com>
Para: "rrd-***@lists.oetiker.ch rrdtool" <rrd-***@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
Â
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 <***@gmail.com>
Para: "rrd-***@lists.oetiker.ch rrdtool" <rrd-***@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
Â