Community discussions

MikroTik App
 
User avatar
Tony Burton
newbie
Topic Author
Posts: 37
Joined: Sun Oct 23, 2005 11:02 am
Location: New Zealand
Contact:

Execute Function Documentation

Wed Aug 29, 2007 10:15 pm

Is there any documentation on the "execute" function?

I would like to write my own functions for data sources, but can't find any documentation on this function.
 
VTWifiGuy
Frequent Visitor
Frequent Visitor
Posts: 53
Joined: Wed May 23, 2007 10:19 pm

Re: Execute Function Documentation

Thu Aug 30, 2007 1:38 am

Ive been using it to execute batch files and programs in the dudes data directory i have no idea if this is the intended purpose. :lol:
 
User avatar
Tony Burton
newbie
Topic Author
Posts: 37
Joined: Sun Oct 23, 2005 11:02 am
Location: New Zealand
Contact:

Re: Execute Function Documentation

Thu Aug 30, 2007 11:23 am

Hi VTWifiGuy, do you have any examples that you could share with me?
 
VTWifiGuy
Frequent Visitor
Frequent Visitor
Posts: 53
Joined: Wed May 23, 2007 10:19 pm

Re: Execute Function Documentation

Fri Sep 07, 2007 11:38 pm

if your executing on the server you have to type in the absolute path of whatever you are doing and if i recall it will execute from the root directory i could be wrong there. So i have batch files i uploaded remotely and i have a notification that executes on server c:\progra~1\dude\data\files\test.bat
 
User avatar
Tony Burton
newbie
Topic Author
Posts: 37
Joined: Sun Oct 23, 2005 11:02 am
Location: New Zealand
Contact:

Re: Execute Function Documentation

Sat Sep 08, 2007 1:44 am

So what is the syntax for the execute command?
 
VTWifiGuy
Frequent Visitor
Frequent Visitor
Posts: 53
Joined: Wed May 23, 2007 10:19 pm

Re: Execute Function Documentation

Sat Sep 08, 2007 2:18 am

as i said i am sure im not using this feature correctly. I set up a notification of type 'execute on server' and in the white box i put in 'msdos based command i want'
 
User avatar
Tony Burton
newbie
Topic Author
Posts: 37
Joined: Sun Oct 23, 2005 11:02 am
Location: New Zealand
Contact:

Re: Execute Function Documentation

Sat Sep 08, 2007 4:05 am

anyone?
 
nms_user
just joined
Posts: 16
Joined: Mon Aug 14, 2006 12:06 pm
Location: Germany

Re: Execute Function Documentation

Thu Sep 13, 2007 10:24 am

Hi,

I'm using DudeV2.2 and created some execute-functions. The following one for example returns Array-Index 0 (array_element -> Return Code) of the returned values of executing program.exe, parameters passed to the .exe, and where the .exe resides (Path). I think this should work with a .bat anyway...

--> array_element(execute("check_nrpe.exe", concatenate("-n -t 10 -c nt_check_disk_c -H ", device_property("FirstAddress")), "D:\Programme\cygwin"), 0)

And here the syntax description given from Mikrotik:

"executes program, returns array of three elements - return code, standard output, standard error. return code is -1 if error occurs. Only first parameter mandatory. First paramerter - command, second - parameters, third - path, forth - input string to pass to program, fifth - timeout in seconds (default 5.0)"

Hope this is what you need...

Who is online

Users browsing this forum: No registered users and 16 guests