2
2
2k212022-04-13 18:05:45
linux
2k21, 2022-04-13 18:05:45

Mikrotik+SSH parse the output. How to make ssh pass a large screen width?

Good afternoon.

I connect via ssh to the mikrotik router, execute the command to request ip to the address sheet.
If I connect with my hands, the output is more complete. Example:
6256e62a0b0be958510339.png
If I connect to execute one command from bash, the output is truncated. Example:
6256e656d52c1889978418.png

It feels like a shorter "screen" width is being transmitted.

Tried the -t switch. But then after executing the command, there is no shutdown. So it hangs in the ssh'e of the router.
Please tell me how to configure ssh to pass a large "window width".

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
paxlo, 2022-04-13
@2k21

The easiest option is to upgrade RouterOS to version 7 (it has been stable for a long time). They fixed the width of the terminal. Here is an example of executing the same command in 6 and 7:
625715c2e45e0329882071.jpeg
But if you have to suffer with the 6th, then as a solution is to abandon print in favor of the put / get combination and getting only the necessary columns.

G
Gregory, 2022-04-13
@Maxlinus

what ssh client?

D
Dmitry, 2022-04-21
@L0m

> Tried the -t switch. But then after executing the command, there is no shutdown. So it hangs in the ssh'e of the router.
I didn’t work specifically with Mikrotiks, but maybe there you can send several commands, as with a regular shell and through "&&" or ";" besides the given command, add another logout (or whatever it is in Mikrotik / quit or something)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question