Community discussions

MikroTik App
 
makkan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 82
Joined: Mon Jul 26, 2010 12:38 am

send remote commands

Tue Oct 05, 2010 4:28 pm

Hi,

I am wondering if there is any way to send custom remote commands/scripts to the Mikrotik by using the dude (or smth else)?

For example, sometimes I would want to add a firewall rule to 5 of my Mikrotik routers and I would want to automate this. Is this possible?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: send remote commands

Tue Oct 05, 2010 4:36 pm

The most popular and scalable options would be a file named whatever.auto.rsc containing the commands to run (files ending in .auto.rsc are automatically executed when uploaded), or to use the API. The API has extensive wiki documentation.
 
makkan
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 82
Joined: Mon Jul 26, 2010 12:38 am

Re: send remote commands

Tue Oct 05, 2010 4:43 pm

Hi,

Thank you!
Sounds reasonable, but can e.g. the dude upload a file to multiple routers? :-)
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: send remote commands

Tue Oct 05, 2010 5:18 pm

No idea, I don't use that program.
 
User avatar
znet
Member Candidate
Member Candidate
Posts: 131
Joined: Mon Jul 24, 2006 8:07 pm
Location: Houston, Texas

Re: send remote commands

Fri Oct 15, 2010 2:41 am

Hi,

I am wondering if there is any way to send custom remote commands/scripts to the Mikrotik by using the dude (or smth else)?

For example, sometimes I would want to add a firewall rule to 5 of my Mikrotik routers and I would want to automate this. Is this possible?
From within the Dude, you can use the function ros_command() to execute scripts local to the routeros device, and retrieve, otherwise unavailable variables. You must be able to write an ROS script, or at least be familiar with the CLI. It takes a little work to familiarize yourself with how the interaction works, but it has proven extremely useful for anything that can be done with a script. There are many parameters visible in winbox that dont have an SNMP oid, such as SNR for a wireless connection. Executing 'on-demand' commands is a little more complicated, but pays off in the long run once you figure out 'your' way to get it done...There is nothing wrong with using the 'whatever.auto.rsc' method if this isnt a thing that you need to perform often.

ros_command is powerful, and worth looking into, if not for other tasks that you havent thought of yet. Try it and you will see the possibilities that are opened up, especially the so-called 'cant do it with the Dude' tasks. 8)

Who is online

Users browsing this forum: No registered users and 39 guests