scripting snmp/ssh/telnet

Can the mikrotik scripting language yet support gathering some variables via either snmp telnet or ssh and make some decisions based on the values?

In my searching it would seem not possible but i’m just checking in case new versions can or anybody has found a way?

no, internal scripting language cannot do that for you. you either have to use Expect scripting language since ssh and telnet is more interactive interface and it is not possible do SNMP queries from within the RouterOS.

if you have some linux host in your network then you can set up it to monitor devices using the Dude or already named expect script.

Thanks. I thought that was the case. Looks like Expect scripting language will do the job easy though.

Cheers.

There’s also API… it’s the most reliable way to do this in fact (using stuff like Expect will produce odd results if the shell UI changes a little; with API, if stuff changes in an incompatible way, you’ll know, and could potentially deal with it).

yes, completely forgot to mention API as a way to communicate with the router. That should be considered the safest way how to communicate with the router as devs also have promised to not to make changes to protocol itself, however commands may change along with the CLI changes.