Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10101

clarify documentation regarding dollar signs in user parameters

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 3.0.0alpha4
    • Documentation (D)

      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 }'
      

            Unassigned Unassigned
            asaveljevs Aleksandrs Saveljevs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: