Telnet result in script

Hi guys,

My question is - is there a way to have in local variable result of telnet connection. I would like to have a script that monitors one of services on server and i would like to achieve that with telneting on specific port and check if connection is possible.

I know that i can use netwatch to ping server, but this doesnt check service status.

It is possible to write this kind of script on mikrotik?
I tried something like this :local telnetres [/system telnet 192.168.1.23 23], but telnetres variable is empty and telnet connection was visible in console output.

Thanks in advance.

no. there is no such possibility using telnet. However coming in 6.0 you will be able to save output of ssh client output to file.

Too bad… I will find another way.

Thanks for your answer.