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

    Details

    • Type: Incident report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0alpha4
    • Fix Version/s: None
    • Component/s: Documentation (D)
    • Labels:

      Description

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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: