Community discussions

MikroTik App
 
User avatar
rwrocket
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 80
Joined: Mon Nov 24, 2014 8:08 am

How to start Wireless Sniffer in a script?

Mon Apr 13, 2015 9:16 am

Title says it all

I cannot find any information on how to run the Wireless Packet Sniffer any other way than clicking on the start button.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: How to start Wireless Sniffer in a script?

Mon Apr 13, 2015 1:41 pm

The equivalent of pressing the start button in script is "/tool sniffer start", and of course, "/tool sniffer stop" for stopping.

See this manual page for all packet sniffer related commands and settings.

EDIT: Wait, I'm sorry... You meant "Wireless sniffer", not "Packet sniffer". I got confused by the combined "Wireless Packet Sniffer"...

For that, see this portion of the Wireless manual page for the settings, and as for the command... It's called "sniff", in that very menu ("/interface wireless sniffer"). It works pretty much the same as how "print" works, except that the list is filled gradually.
 
User avatar
rwrocket
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 80
Joined: Mon Nov 24, 2014 8:08 am

Re: How to start Wireless Sniffer in a script?

Tue Apr 14, 2015 2:26 am

Great that was what I needed, the sniff command.

Now if only I could run it with a filter? but as far as I have read so far there is no filter commands for the wireless sniffer like there is for the other packet sniffer?
 
User avatar
rwrocket
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 80
Joined: Mon Nov 24, 2014 8:08 am

Re: How to start Wireless Sniffer in a script?

Tue Apr 14, 2015 4:47 am

Can anyone advise me on how I can script this to run for a time period then stop?

I see the sniff commands can be run with the following attributes but I am also not sure what they do.

<interface> --
append --
as-value --
do --
file --
interval --
once --
without-paging

I can press Q to stop it running in the terminal but I am not sure how to script Q after a delay
:delay 10
q doesn't seem to work
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: How to start Wireless Sniffer in a script?

Tue Apr 14, 2015 6:37 pm

Huh. Most other similar commands have "duration", which does just that, but here...

I guess you could use "once", which should in turn only sniff whatever can be immediately seen, and stop sniffing afterwards (rather than wait, and keep the list "fresh"). If you want to apply something for each network (e.g. check it against some criteria), you can use the "do" argument. It contains variables identifying the particular item. While inside the script, press "$", and tab, to see the possible variables.

Who is online

Users browsing this forum: No registered users and 5 guests