Looks like the $dateoutput is not getting the escaped colons, so RRDTool gets a command string without the colons escapes and thinks they are command modifiers... Maybe try single quoting the $date->format string rather than double quoting?
In perl, something like $dateoutput ~= s/:/\\:/g ; would fix it. Not sure about PHP. Steve Shipway University of Auckland ITS UNIX Systems Design Lead [email protected] Ph: +64 9 373 7599 ext 86487 ________________________________________ From: [email protected] [[email protected]] on behalf of Berny Stapleton [[email protected]] Sent: Thursday, 30 August 2012 5:10 a.m. To: [email protected] Subject: [rrd-users] RRD and PHP Date not working Hi there, I'm using RRDTool 1.3.8 with php-pecl-rrd on CentOS 6. I'm trying to put a comment onto a graph, and it doesn't like the colon. I've looked through the list archives and I'm not coming up with the right answer or syntax to make this work... So I've got this: $date = new DateTime("now", new DateTimeZone('Europe/Dublin')); $dateoutput = $date->format("d M Y G\\:i\\:s"); "COMMENT:Created on $dateoutput", I've tried \\ and \ and nothing seems to get me over this hump, I'm still getting " 'Exception' with message 'I don't understand ':25:49' in command: 'COMMENT:Created on 29 Aug 2012 17:25:49'" So, what I've seen in the list is that appending :strftime works, but this seems to exist only under perl and not pecl-rrd; well, maybe I've got it wrong, but when I tried it I got: "'I don't understand ':35:08:strftime' in command: 'COMMENT:Created on 29 Aug 2012 16:35:08:strftime'" Does anyone know how to get around this in PHP? Thanks, Berny _______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users _______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
