4.11 API bug: /queue/simple/print not giving access to stats

Unable to find anything in the changelog regarding this so I’m assuming it’s a bug. /queue/simple/print no longer gives access to the statistica properties; IE what you get when running ‘/queue simple print stats’ at the console.

RouterOS Version 4.11

15/08/2010 09.34.25 - info 102 - EXECUTE= /queue/simple/print =.proplist=name,bytes,packets
15/08/2010 09.34.25 - DEBUG 11001 - 10.0.0.1 tr_mkrouter.msend /queue/simple/print
15/08/2010 09.34.25 - DEBUG 11001 - 10.0.0.1 tr_mkrouter.msend =.proplist=name,bytes,packets
!re=name=foo
!re=name=bar
!re=name=baz

RouterOS Version 4.4

15/08/2010 09.34.25 - info 102 - EXECUTE= /queue/simple/print =.proplist=name,bytes,packets
15/08/2010 09.34.25 - DEBUG 11001 - 10.0.0.2 tr_mkrouter.msend /queue/simple/print
15/08/2010 09.34.25 - DEBUG 11001 - 10.0.0.2 tr_mkrouter.msend =.proplist=name,bytes,packets
!re=name=foo=bytes=0/0=packets=0/0
!re=name=bar=bytes=0/392=packets=0/8
!re=name=baz=bytes=979/0=packets=14/0

This is happening on both the Delphi API client as well as my Perl API client. Communication works properly, the router simply doesn’t respond to the bytes or packets properties. Don’t have a full suite of RouterOS revisions to test against so I’m unable to give a hard verion where this behavior started. However, I’m fairly certain I have this code running against routerOS as new as 4.6 with no issues.

Edit: Checked, most recent revision I have running that exhibits the latter behavior is 4.5.

I think the new command/parameters are:
/queue simple print stats

So API should be something like
/queue/simple/print=stats=

15/08/2010 12.03.09 - info 102 - EXECUTE= /queue/simple/print stats
15/08/2010 12.03.09 - DEBUG 11001 - 10.0.0.1 tr_mkrouter.msend /queue/simple/print stats
!trap=message=no such command
!done

Also, docs still say:

API print command differs from the console counterpart in the following ways:

  • arguments that modify list of returned properties (detail, breif, …) have no effect in the API.


    Edit:


    15/08/2010 12.07.54 - info 102 - EXECUTE= /queue/simple/print=stats=
    15/08/2010 12.07.54 - DEBUG 11001 - 10.0.116.1 tr_mkrouter.msend /queue/simple/print=stats=
    !trap=message=no such command
    !done


    Also, /queue simple print stats in the console isn’t really new.

Not new. Just different that earlier versions. This user API manual shows the command
/ip address print follow
as

/ip/address/print
=follow=

So if it does take print parameters (except detail and brief), that would mean

/queue/simple/print
=stats=

should be correct.

http://wiki.mikrotik.com/wiki/API_command_notes#Details

Ah, as seperate words?

15/08/2010 13.13.58 - info 102 - EXECUTE= /queue/simple/print =stats= =.proplist=name,bytes,packets
15/08/2010 13.13.58 - DEBUG 11001 - 10.0.0.2 tr_mkrouter.msend /queue/simple/print
15/08/2010 13.13.58 - DEBUG 11001 - 10.0.0.2 tr_mkrouter.msend =stats=
15/08/2010 13.13.58 - DEBUG 11001 - 10.0.0.2 tr_mkrouter.msend =.proplist=name,bytes,packets
!re=name=foo=bytes=0/288=packets=0/6
!re=name=bar=bytes=0/0=packets=0/0
!re=name=baz=bytes=1140/0=packets=15/0

Time to get cracking. Thanks!

Hi all

I am vb.net programmer and I need to get target upload bytes and target download bytes for my users queue.

Please tips me to send this command to the rb750.

Thanks in advance.
M.Yazdian

follow the same pattern as with other commands, you can look up what CLI command is returning your arguments.

Most probably same as previous guy found out:

/queue/simple/print
=stats=

or


/queue/simple/print
=detail=

you can limit with .proplist to what arguments to return.

Hi janisk

I need to get the users queue statistic.

I try this command

mik.Send(“/queue/simple/print/=stats=.id=*8”, True)

Butt get this Message:

!trap=message=no such command
!done

command is 2 lines, that means, you send 2 lines. please see documentation of API and of client you are trying to use.

Hi janisk
Thanks for tips.
janisk now I need to kick my pppoe active users and I tried this commands but this command is not working.

mik.send(“/ppp/active/remove”,false)
mik.send(“=.id=*6FA”)

Can you help me?
Thanks in advance

what was the response from router?

Good day
is it possible to get stats of queue with only read user?? even with write user u can not, so u’ll need full access to get rate of simple queue :frowning:

/queue/simple/print
=stats=
?name=somequeue
=.proplist=rate

v 5.7 x86
…not enough permissions…

v 5.7 rb411a it works sometimes !!!

Maybe if you have “read”, “sniff” and/or “test” privileges to that user?

no, not even write user (same than full except by policy and ftp) :frowning: