Community discussions

MikroTik App
 
User avatar
lwaclawiak
just joined
Topic Author
Posts: 9
Joined: Fri Sep 13, 2019 8:26 pm

How to run a script locally on routeros from dude installation?

Fri Jun 18, 2021 11:05 pm

I would like to use scripts created directly in dude's routeros to test some hosts.

I need to create a probe that when assigned as a service to a host(192.168.0.10), execute a command locally on the dude's routeros installation(127.0.0.1), passing the host's ip as an argument.
The idea is to run a script, passing it the host ip and get the return of this test and use it as a probe on the host.

Something like a function ros_command(":global HostToTest 192.168.0.10 ; /system script run test) "127.0.0.1"

My problem is that I don't know how to make ros_command run on localhost(127.0.0.1) instead of running on remote host when it's called as a function or probe.

Any help will be greatly appreciated.,
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 5768
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: How to run a script locally on routeros from dude installation?

Sun Jun 20, 2021 1:57 am

Actually is impossible.
 
User avatar
lwaclawiak
just joined
Topic Author
Posts: 9
Joined: Fri Sep 13, 2019 8:26 pm

Re: How to run a script locally on routeros from dude installation?

Sun Jun 20, 2021 7:36 am

Actually is impossible.
It's sad to read this.
My ultimate intention is to be able to monitor packet loss for remote hosts.
For remote hosts running RouterOS I managed to solve the problem with ros_command and scripts installed on the remote host that do a packet loss test from the remote host and return the results, so I can test the communication between the remote host and specific ips and generate graphics.
For remote hosts running linux I was also able to resolve the issue by creating scripts on linux hosts to test packet loss, and installing these scripts on xinetd to listen on a specific port and using dude's tcp probes to fetch the results. I could also use an snmp server on linux to return these values.

But in the case of simple remote hosts like printers, non-RouterOS wifi routers, windows computers and internet hosts, I couldn't find a way to calculate packet losses and generate graphs.
Unfortunately.
If anyone else has any ideas on how to do it I would be very grateful.

Who is online

Users browsing this forum: No registered users and 26 guests