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

Allow multiple return values from a UserParameter


    • 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


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

      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.

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

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

      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.




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


              • Created: