help - how to simple this script

Hai All … I’m newbie on ROS Script , I need to email all my client’s rate and I have this script and work :

/queue tree
:global nclock [/system clock get time];
:local ahMAX [get [find name="D---AH---MAX"] rate]
:local ahASUSN43 [get [find name="D---AH---ASUS---N43"] rate]
:local ahQNAP [get [find name="D---AH---QNAP"] rate]
:local totalrate [get [find name="DW"] rate]



/tool e-mail send to="email@email.com" subject="Rate $totalrate kb at $nclock" \
body=("AH---MAX64---------> $ahDESK kb \
\nAH---ASUS---N43---> $ahASUSN43 kb \
\nAH---QNAP-----------> $ahQNAP kb") \

i have 25 client and i have to make that scipts simple , and i try to make this script below but not work ,can anybody help my ? thks

:global result " "
:global list "" 

:foreach i in [/queue tree find] do={
   :if ([:find [/queue tree get $i parent] "DW-1"]=0) do={
      :set list ($list . "," . $i name) 
      :set resulter ($result . "\n" . $list . "-------------->" [get [find name="$list"] rate])
    }
}



/tool e-mail send to="mail@mail.com" subject="Rate" body=("$result") tls=yes

sorry for my bad english

I can’t help you with the script, but I think you’re trying to solve the wrong problem - or rather, you’re using the wrong tool.

If you need to provide details and history on queue trees, you should build an NMS (network monitoring system) that can use SNMP to monitor your queue trees. You can poll the router for all the queues and get back their name, packet count, byte count, etc. and then graph that information in real time and historically. Then you make the view of specific queues available to whoever needs access. You can send alerts if thresholds are crossed, and do all kinds of neat things. The Dude by Mikrotik is a free NMS, and while I’m not sure if it can graph queues like that it well might.

That’s a much better solution than to be sending out emails all the time.

Thanks Fewi , i Will Try it …