I never tried MT scripting so I’m having a little trouble to make this work…
Consider the command “ppp active print detail without-paging”… Let’s say I need to filter its output to only show me the lines where the usernames start with the letter “a”…
The following command if pasted into the terminal will print all ppp active users having names starting from “ex”:
:global list “”; :foreach i in [/ppp active find] do={:if ([:find [/ppp active get $i name] “ex”]=0) do={:set list ($list . “,” . $i);}}; /ppp active print detail without-paging from $list;
True, and I don’t have much of a problem composing cryptic statements, but the same cannot be said for everyone.
There are many times when our tech support group has expressed frustration at the difficulty of searching in RouterOS. I usually end up telling them to use Winbox, sort on the column of their choice, and scroll through until they find what they are looking for. It’s inefficient, but it’s easier than trying to debug long commands (especially when ROS doesn’t really have any debugging tools), and much easier than trying to explain the complexities of ROS syntax to a first-year collage student answering phones.
On the other hand, with the vendor C gear, I can simply tell them to do a ‘sh ip arp | incl 0c13’, for example. Simple, and concrete. There just isn’t an equivalent in ROS that can be handled by a $9/hr tech. In general, MT gear is much more user friendly than vendor C’s, but in this particular area, MT is lacking.
Even I would often rather type 15 characters and be done with it, rather than stretching the command out to 100+. It would also be quite nice to have regular expressions available, for those more complex searches.
Once the API is released, this will likely become moot, since we will be more easily able to create our own interfaces (yes, it can be done now with SSH and Expect, but that gets has it’s own problems). But at this time, the lack of an easy search function is one of the biggest frustrations we have with MT.
Yes… I’m aware of grep and that’s what I’m using for now… But what eflanery said is true, a command inside MT would be alot more useful… And I would go a little more far than that… Not a grep, but something that would make the “ppp active print” list only what u ask so it wouldn’t have all the stress of going on 1000 users to print just 2 of them…
Sorry about any grammar mistakes… English isn’t my first language…
Flip, would love to have grep.
I am an experianced linux/unix admin and infrastructure expert, not not a bloody programmer!
I normally work this stuff out after few hours, but is such a waste of time!
Hope fully someone can help!
Im trying to overcome yet another bug in MT.
it seems that my web-proxy often stops working.
it would be nice if i could do a “ip proxy monitor once” and filter for status to restart it eventually!
Tried modifying above code to …
:global list ""; :foreach i in [/ip proxy monitor once find] do={:if ([:find [/ppp active get $i name] "status"]=0) do={:set list ($list . "," . $i);}}; /ip proxy monitor once from $list;