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

Allow multiple return values from a UserParameter

    Details

    • Type: Change Request
    • Status: Need info
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Environment:
      Debian, Zabbix 1.6.6

      Description

      It would be nice if a UserParameter could return more than one value.

      (1)
      Take Nagios for example. Their plugins return both a status code (OK, WARN or ALERT) and a text string.
      The status is triggering a notification if needed and the text string is just added to the notification.
      But Zabbix currently doesn't accept these two bits of information from a UserParameter.

      My current task is to monitor a MySQL database replication. I usually have the number of seconds that
      a replication lags behind the master. But things can go wrong and the replication has stopped or I can't
      reach the database or whatever has happened. The shell plugin I wrote knows all these cases
      but cannot properly communicate them to Zabbix. My current workaround is that I return a positive
      number of the number of seconds of replication lag. And -1 if the database is down, -2 if the replication
      has stopped, -3 if I lack permission to access the database and so on. This looks stupid in the graphs.
      So I wished I could return the number of seconds latency as usual but also a general status in the same run
      including a free-form text.

      Example:
      return value #1: UNDEF seconds lag
      return value #2: status: error
      return value #3: status text: Master database server has become unreachable.

      Example:
      return value #1: 129 seconds lag
      return value #2: status: ok
      return value #3: status text: -

      (2)
      Some commands can gather multiple parameters and returning them. But currently Zabbix
      only supports one paramter per UserParameter. As a bad example a shell command may need to be called
      ten times (with the same parameters) to return ten different values.

      Random example:

      UserParameter=mysql.replicationstatus,somecommand | awk '{print $1}'
      UserParameter=mysql.replicationlag,somecommand | awk '{print $2}'
      UserParameter=mysql.replicationposition,somecommand | awk '{print $3}'
      

      It would be nicer if "somecommand" could just be called once and return three values that Zabbix can deal with.

      Hope this makes any sense.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              signum Christoph Haas
            • Votes:
              33 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated: