Hello, I think this might work for you, just replace your script with this. You can change the $interfaceParam and $addressParam to anything you like and it should output the correct identity. Feel free to ask any questions if something doesn't work for you.
CODE: SELECT ALL
# DEFINE YOUR SEARCH PARAMETERS
:local interfaceParam "bridge1";
:local addressParam "^192.168";
# INITIALIZE VALUES
:local loop [:len [/ip neighbor find where interface=$interfaceParam address~$addressParam]];
:local id [/ip neighbor find where interface=$interfaceParam address~$addressParam]
:local rogueIdentity;
# OUTPUT THE NUMBER OF ROGUE DEVICES DETECTED
:if ($loop>0) do={:log warning "There are $loop rogue devices"} else={ :log warning "No rogue devices detected"};
Thank you so much , It's works a expected
You are really a genius , And there is an Arabian saying : teach me fishing better than fish me a fish
Where can I find the basic rules for learning scripting ?
Best Regards my hero !
Happy to help.
I suggest starting here
https://wiki.mikrotik.com/wiki/Manual:Scripting , all you have to do is just take one router and try to write some basic things, whatever comes to mind, for example: Periodically check routers CPU temperature and output it to console or log. I suggest learning all about {find} and {get} commands in ROS, they are extremely valuable and will definitely be part of most scripts.
There are also some script examples to learn from here:
https://wiki.mikrotik.com/wiki/Manual:S ... g-examples and here:
https://wiki.mikrotik.com/wiki/Scripts , you can see how some things are done and build on that.
The best practice to get better at scripting your Mikrotik is to just do it, trial by error. You'll get there!