This is probably because Zabbix executes user parameters using /bin/sh
, not /bin/bash
. So you can either try to adapt your command to work with /bin/sh
or prefix it with /bin/bash
, like so:
UserParameter=testparam,/bin/bash -c '...'
Alternatively, you may wish to try rewriting your command in a style similar to this:
UserParameter=testparam,var=`exit 1 || echo 'col1 -1'`; test "`echo $var | awk '{ print $2 }'`" = 0 && echo OK || echo FAILED