Community discussions

MikroTik App
 
rivmont
just joined
Topic Author
Posts: 2
Joined: Fri Aug 07, 2015 8:55 pm

Parameters in a function

Wed Nov 20, 2024 1:16 am

Is there a way to send parameters to a function using a probe? There are many multiple OIDs I want to monitor on different interfaces and I was wondering if there was a way to create functions that can be used by multiple probes by sending a parameter instead of having to write a new function for each interface.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4276
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Parameters in a function

Wed Nov 20, 2024 3:12 am

I have an example of using a function in a probe here:
viewtopic.php?t=192103&hilit=probe

It does not use not function parameters, however. I just created multiple functions rather than take an argument. Reason being is I'm not 100% on how to correctly use arguments. $1 etc should work, but the syntax gets wonky and undocumented so I didn't try further... but $1 $2 is AFAIK how you do it.

Maybe someone else can chime in, since without a bunch of trial-and-error, IDK....

Who is online

Users browsing this forum: kompetencia and 2 guests