-
Incident report
-
Resolution: Fixed
-
Minor
-
None
-
3.0.0alpha4
Documentation page at https://www.zabbix.com/documentation/2.4/manual/config/items/userparameters says the following:
To use positional references unaltered, specify double dollar sign - for example, awk '{print $$2}'. In this case $$2 will actually turn into $2 when executing the command.
This dollar sign quoting, however, only works for user parameters that accept arguments. For user parameters that do not accept arguments, such quoting does not work, because references like $1 are not processed. It would be nice to mention that explicitly in the documentation.
For instance, the following two parameters are equivalent in their output:
UserParameter=stackoverflow1,grep zabbix /etc/passwd | awk -F: '{ print $1 }' UserParameter=stackoverflow2[*],grep zabbix /etc/passwd | awk -F: '{ print $$1 }'