I am trying to use the Exec Binding for the first time and just ran into an issue:
My command line contains colon characters because I have to pass a MAC address to a check-script:
Number Stephans_iPhone_last_seen_secs “Stephan’s iPhone zuletzt gesehen vor [%.0f Sekunden]” <man_1> { exec="<[/usr/local/get_mtime_diff.sh ab:cd:ef:gh:ij:k:1000:]" }
Obviously this doesn’t work because the colon is also the separation character. I tried to put the commandline into ’ ’ and also tried to escape the colons in the commandline with an backslash character ( : ) but both didn’t work. Is there a safe way to use colons in the commandline?
thanks for your answer. Of course I could use replace the ususal MAC-address separator “:” with some other charakter and re-replace it with “:” in the script that is executed (I exactly need the colon notation in the script).
But I did hope that there would be a “clean” way to deal with colons in the command line (E.G. escaping the colons somehow), but that doesn’t seem to be the case, so I will do it the dirty way that you described.
What about if you defined MAC addresses in the script and pass in a constant name in the .items file? Might make it cleaner than putting mac address in semicolon?
Number Stephans_iPhone_last_seen_secs "Stephan's iPhone zuletzt gesehen vor [%.0f Sekunden]" { exec="<[/usr/local/get_mtime_diff.sh StephaniPhoneMac:k:1000:]" }
Looking at the wiki I’m surprise the single quotes or the escape “” didn’t work!