Fumi
April 23, 2009, 5:19pm
1
Hi TikPeople!
How can make traffic monitor to specific interface with API commands?
/interface monitor-traffic ether2
in API??
/interface/monitor-traffic
?name=ether2
=once=
This not work.. This command make monitor traffic of interface ether1.
Thanks!
/interface/monitor-traffic
=interface=ether2
=once=
BUT!..
monitor-traffic, ping, torch and other complex commands do not work via API now. they just return ‘!re’…
Fumi
April 24, 2009, 8:04am
3
Hi!
/interface/monitor-traffic
=interface=ether2
=once=
it’s work!
Thanks
janisk
April 24, 2009, 12:33pm
4
you use queries only for print command, not for torch where you have to set actual parameters for command to work at all.
wow! monitor-traffic works in 3.23! then torch should arrive soon )))
Fumi
April 27, 2009, 8:03am
6
Thanks janisk for aclaration!
We will be wait for API news!
Fumi
May 5, 2009, 4:11pm
7
How I can print N first lines of log?
/log/print
???
Thanks
you may print full log and then process the only lines you need
btw, ‘first lines’ are the middle of the log, the bost recent messages are the last ones - why do you need first lines?
Fumi
May 6, 2009, 8:07am
9
I need only read a few lines because if I read all lines (400) i need wait time because my application work in remote mode…
If I can read first 10 lines and after folow 10 lines..
Thanks
do you have 9600 bps dialup modem for remote access?.. what do you mean ‘i need wait time’?
what exactly do you need to do?
Fumi
May 6, 2009, 4:59pm
11
A user connects to the router from home.
The router is in another site.
The program read log entries of router. If program reads all the entries in the log, user should wait too long time.
If the program could read ten lines first and next read ten follow lines I think that option will be better…
Thanks
what bandwidth does the user have?..
Fumi
May 7, 2009, 8:08am
13
I don’t know.. 128K 256K… but read 500, 1000 lines of log is not more efficient…
well, in API you can issue parallel commands, so you cal load log in background (by tagging your API query)
Fumi
May 7, 2009, 12:05pm
15
Yeah, I think in this option..
I think option to read N entires of command would be better…
possible scenario is the following:
you read 10 lines: from 1 to 10
router adds 2 lines to log, shifts the log up
you read next 10 lines: from 11 to 20. but you have skipped two lines of log =)
so the preferred way of reading the log and then listening for changes is
/log/print
=follow=
hrico
May 4, 2010, 6:03pm
17
I get the reply if I use “=once=” but,
…if i want to use for example “=interval=2” it does not show anything.
Also how is it with the /cancel command?
Should I use it somehow like this:
mikrotik.Send("/interface/monitor-traffic");
mikrotik.Send("=interface=ether1");
mikrotik.Send("/cancel");
mikrotik.Send(".tag=traffic",true);
…because that also not realy works.
/interface/monitor-traffic
=interface=srv
=interval=2
works fine for me (tested in v4.2)
also, you should send ‘/cancel’ command only when you don’t need more execute previous command. p.s. ‘/cancel’ is command, not parameter