I can't turn off the console colours

Hi, according the manual I should be able to turn off the colours by loggin in as

admin+c@…

but when I tried at 6.x to record the commands (using autoexpect), it just didn’t work, my prompt looked like

expect -exact “\r\r\r^[[9999B[admin@DD-RB433] > ^[7^[[r^[8”

…and e that should invoke “dumb” terminal mode wasn’t any better.

Any better idea how to get just a pure ASCII so I can automate easily?


Thx

Use the API protocol instead of SSH or whatever. It’s much less error prone in general when it comes to automation. You can see implementations for various languages at the bottom of the linked manual page.

Thanks but that is an overkill for me to start studying a new way to control Mk.

It’s not a big learning curve. Considering all the stuff you need to handle with SSH and Expect (not just colors…), it will take you less time to learn to use the API and make your scripts than to handle all of those cases reliably (as in “so that they don’t brake with the next minor RouterOS upgrade”).

Some implementations (my one, the Java one by LeGrange) allow you to use terminal-like commands, so there’s really nothing to learn, except the client itself. Well, OK, almost… you must explicitly specify nameless arguments, since the protocol doesn’t allow for them, and there’s no way to infer them… but…

Some implementations (certainly my one) even allow you to relatively easily just run ACTUAL script code, by automatically wrapping it around a script in “/system script”, executing it, and removing it after execution.

e.g. using my PHP client:

<?php
use PEAR2\Net\RouterOS;

require_once 'PEAR2_Net_RouterOS-1.0.0b4.phar';

$util = new RouterOS\Util($client = new RouterOS\Client('192.168.0.1', 'admin', 'password'));
$util->exec(
    '
    /interface disable $interfaceName
    :delay 2
    /interface enable $interfaceName
    ',
    array(
        'interfaceName' => 'ether1'
    )
); 

Thanks for all the tips, but I just settled with parallelSSH and now I feel very well with clusterssh.
I can’t handle all my Mikrotiks seriously this way at once, but doing that interactively on more than one box is still a relief.
4.02_03 (a package in Lubuntu 14.04) works like charm with RouterOS 6 .

Anyway, if you come with another simplistic solution, it may be fun.