I need to download statistics of queue tree. However, there is many of them ~ 2300. All of them have loong descriptive names which render tool /queue tree print bytes unusable, cos they simply don’t fit into terminal output and names are partialy replaced with dots.
I have managed to put statistics to file, but there is problem with max file size arround 4000b (then I got error -contents of file too long or such)
I tried to send stats by e-mail body, but this is not optimal for further parsing by our system and there is probably another limit too, forcing me to divide mails to 5 parts/500 queue.
one of my test
:global pocetQT;
:set pocetQT (get [/queue tree print count-only]);
:global traf;
:global resulter " ";
:global datum [/system clock get date];
:global vrijeme [/system clock get time];
:global CustMark "none ";
/file print file=stats1;
/file set stats1.txt contents="";
/queue tree
print count-only
:for i from=0 to=499 do={
:global CustDATA [/queue tree get $i bytes ]
:global CustName [/queue tree get $i name]
:global CustMark [/queue tree get $i packet-mark]
:if ($CustDATA ="") do={
:global CustDATA "0"
}
:if ($CustMark ="") do={
:global CustMark "none"
}
:put (($i) . ";" . ($CustDATA) . ";" . ($CustName))
:set resulter ("$resulter \n; $CustMark;$CustName;$CustDATA;")
/file set stats1.txt contents=$resulter;
}
/tool e-mail send from=me@me.org to=recepient@server.cpm subject="1_data_radio $datum $vrijeme" body="$resulter" file=stats1.txt server=XXXXXXXXXXX
There must be a better solution for that, but I’m stuck and hopeless now.
Is there any way how to for example append contents to existing file ?
thanks for any suggestion