I’m trying to get sensor data into Graphite, by piping the values to netcat. As a simplified example of the issue, I have the following in my exec.persist which should send the text “pwd” to my docker host:
My general suggestion is for all things exec to not use the exec binding or persistence until you get it working from executeCommandLine in a rule. So do the following:
create a switch you can use to trigger a rule to test your command
create a rule that triggers on that switch and put the following code in it:
I’m willing to bet you will see an error being returned from your command that isn’t otherwise being captured by the ExecServices log. In my experience on this forum and personally, ALL exec problems are permission problems and this is the easiest way to see them.
I confused thing by using pwd, but I’m just trying to sent a random string and not the output of the pwd command.
Doing research on executeCommandLine(), I think the problem could be similar that discussed here:
And here is a possibly relevant note from the source code on the use of the @@ delimeter:
*
* Executes commandLine. Sometimes (especially observed on
* MacOS) the commandLine isn’t executed properly. In that cases another
* exec-method is to be used. To accomplish this please use the special
* delimiter ‘@@’. If commandLine contains this
* delimiter it is split into a String array and the special exec-method
* is used.
*
*
* A possible {@link IOException} gets logged but no further processing is
* done.
*