Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-1940

Print in agent log (DebugLevel=4) reason of ZBX_NOTSUPPORTED if number of key parameters is more than allowed, etc

    XMLWordPrintable

    Details

    • Type: Change Request
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 2.0.8, 2.1.5
    • Fix Version/s: None
    • Component/s: Agent (G)

      Description

      Try to guess why next will work:

      UserParameter=awk,df -P '/boot' | egrep -A1 '^/' | awk '{s=substr($5,1,length($5)-1);print s}'
      # zabbix_get -s localhost -k awk
      

      or also will work:

      # zabbix_get -s localhost -k system.run["df -P '/boot' | egrep -A1 '^/' | awk '{s=3;print s}'"]
      

      And next will NOT work:

      # zabbix_get -s localhost -k system.run["df -P '/boot' | egrep -A1 '^/' | awk '{s=substr($5,1,length($5)-1);print s}'"]
      

      We can help users to identify reason of the problem if we will print additional message to debuglog.

      Now for the zabbix_get attempt above it looks like:

      24323:20130926:094915.739 Requested [system.run[df -P '/boot' | egrep -A1 '^/' | awk '{s=length($5,1,2);print s}']]
      24323:20130926:094915.739 Sending back [ZBX_NOTSUPPORTED]
      

      and would be good to see something like:

      24323:20130926:094915.739 Requested [system.run[df -P '/boot' | egrep -A1 '^/' | awk '{s=length($5,1,2);print s}']]
      24323:20130926:094915.739 ERROR: number of the key parameters is more than allowed
      24323:20130926:094915.739 Sending back [ZBX_NOTSUPPORTED]
      

      It will require to alter all code entries like:

      if (num_param(param) > 2)
      		return SYSINFO_RET_FAIL; 
      

      Also we could add similar log records for missing (or empty) required key parameters.
      Such checks located below the number of key parameters check in the code.
      This error log could be:

      24323:20130926:094915.739 ERROR: missing required key parameters
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              zalex_ua Oleksii Zagorskyi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: