Hello, I am trying to add a probe to monitor a RRCP switch. There is not an integrated support for that and I am trying to do it with an external execute.
I have set up this function for when there is an error but is doesnt work :
if(array_element(execute("winertlping",device_property("CustomField1")", "Z:\bin",10),2)>0,"","error")
I get a 'parse failed'
the command which I execute is a script which includes this :
/bin/rtlping -c 3 -q $1
I use CustomField1 because I don't find a variable to pass the device's mac address. My CustomField1 has this in it :
52:54:4c:00:00:01@eth1
If I execute the command from shell I get this if there is a connection to the switch :
52:54:4c:00:00:01@eth1 : 0.073 0.010 0.015
And this if no connection :
52:54:4c:00:00:01@eth1 : - - -
So if anyone has any ideas. Is there an error in my function ? Or is it the fact that this is a linux command which I try to execute through wine (it works in 'wine cmd' but the result is echoed in cmd) ?
Is there any other way to do this ?
2nd try : To eliminate the problem of executing a linux command today I'm trying the following :
if(array_element(execute("rtlping.cmd", device_property("CustomField1"), "C:\",30),0)=0,"","error")
and rtlping.cmd contents are :
@echo off
type Z:\var\www\htdocs\rrcp\%1
And I still get 'parse failed'. I don't understand why that is. This should indicate an error in my statement but the example is taken from the wiki and the result from command is 0 if there is a connection and 100 if there is not. As simple as it gets.