Community discussions

 
rojd
just joined
Topic Author
Posts: 3
Joined: Wed Jul 30, 2014 11:12 pm

Snooper

Thu Jul 31, 2014 9:29 pm

Hello I need to through the API (language C #) to obtain data on wireless devices using the Snooper.
However, I am having difficulties, data is transmitted in c#. In this updated version to OS 6.17
Here's the code:
MK mikrotik = new MK("172.20.49.222");
if (mikrotik.Login("admin", "admin"))
{
mikrotik.Send("/interface/wireless/snooper/snoop");
mikrotik.send("=interface=wlan1");
mikrotik.Send(".tag=sss", true);
}

Also features snooper is able to record data to a file, but the file is created through the API empty.
MK mikrotik = new MK("172.20.49.222");
if (mikrotik.Login("admin", "admin"))
{
mikrotik.Send("/interface/wireless/snooper/snoop");
mikrotik.send("=file=wn");
mikrotik.send("=interface=wlan1");
mikrotik.Send(".tag=sss", true);
}

Thank you.
P.S. Sorry for my english.
 
choma
just joined
Posts: 7
Joined: Tue Feb 04, 2014 12:45 am

Re: Snooper

Sat Oct 11, 2014 5:35 pm

BUMP!
 
choma
just joined
Posts: 7
Joined: Tue Feb 04, 2014 12:45 am

Re: Snooper

Mon Oct 13, 2014 10:55 pm

So far the only solution I've come up with is to login to the router via PuTTY and then enable logging to a text file. When you do that and start the Snooper it will write new results to the log file on each refresh. If you want to automate the whole process without having to log in to the router and type the commands, use Plink(a command-line interface to the PuTTY back ends).

I've been bashing my head to find a solution to the Snooper issue for a week now (since it doesn't have a duration parameter like the scan function), and this is probably the best solution out there... you will just have to play a little bit with Plink and public-key authentication if you want your Snooper results in a text file by doing just a double click on an exe.

How to enable logging in PuTTY to save your router session to a txt:
http://the.earth.li/~sgtatham/putty/0.6 ... ig-logging

How to use Plink for process automation:
http://the.earth.li/~sgtatham/putty/0.6 ... html#plink

I hope this helps a lot of you folks who can't do your snooping via scripts.
Also, if someone comes up with a better/faster solution before the MikroTik gods implement the duration parameter, we'd all be more than glad to hear about it.
 
choma
just joined
Posts: 7
Joined: Tue Feb 04, 2014 12:45 am

Re: Snooper

Wed Oct 15, 2014 2:07 am

Update:

The solution above will only work to get the frequency list in your txt, but it is possible to get the stations as well.

Hint: Windows API =)
 
User avatar
Janevski
newbie
Posts: 35
Joined: Sat Dec 31, 2016 10:29 pm
Contact:

Re: Snooper

Sun Apr 09, 2017 6:25 pm

BUMP!
Bump all you want, no one is going to help you.
Three years later, i sincerely hope you got the job done.

Why should there be useful http based standardized api, when there could be abstract, obscure, state of the art proprietary api?

Pride is a sin.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2411
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Snooper

Sun Apr 09, 2017 7:01 pm

In more recent versions of RouterOS, you can use the "/interface wireless snooper flat-snoop" command, even with the API.

The data returned is slightly different, but still has most everything you'd want.
PEAR2_Net_RouterOS(1.0.0b6) - My API client in PHP
(Rate my posts? If you want... no pressure...)
 
User avatar
MaHr
just joined
Posts: 21
Joined: Wed Apr 22, 2009 2:59 am
Location: Czech Republic

Re: Snooper

Fri Aug 25, 2017 8:00 am

I tried flat-snoop command via api, it's working fine but filter, something like ?=type=station is missing. If I want to see only networks or stations I still get frequency use !re lines before I get the right ones. If flat-snoop is running via whole 5GHz band I get too much unnecessary informations.
It will be nice to have ie. /interface/wireless/snooper/flat-snoop wlan1 mode=only-stations/networks/frequencies as working fine in classical snoop command by pressing s/n/f keys if snoop is running. Classical SNOOP but unfortunately doesn't work in API and via CLI unfortunately doesn't contain frequency value if only stations are selected (tested on latest ROS).

Who is online

Users browsing this forum: No registered users and 5 guests