I have this simple script6 which works:
:local i
:foreach i in=[/queue simple find name!="AllQueues"] do={:put ( "IP: " . [/queue simple get $i target-addresses] . "\tBytes: " . [/queue simple get $i bytes] . "\t");}
It generates a chart with the target-addresses and the bytes they've used, but it prints it out to the console.
What I want is to generate the chart and email it. I tried creating the chart in memory like this:
:local i
:local chart;
:foreach i in=[/queue simple find name!="AllQueues"] do={:set chart ( $chart . "IP: " . [/queue simple get $i target-addresses] . "\tBytes: " . [/queue simple get $i bytes] . "\t");}
:/tool e-mail send subject="Queue Stats" to="xxx@xxx.xxx" body=$chart from="xxx@gmail.com" tls=yes port=587 server="74.125.131.109"
And it crashed the router due to a memory overflow. So that is clearly the WRONG way to do it. Any ideas on how I can make this work? I'd prefer not to generate a file as that causes a write to Flash and I want to minimize flash-writes.