Ad Widget

Collapse

How to return no data from user parameter script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chrullrich
    Junior Member
    • Jan 2013
    • 8

    #1

    How to return no data from user parameter script?

    Hello,

    how can I return "no result" from a user parameter?

    I have a user parameter script that invokes an external command, extracts the interesting part of its output and returns it. This is configured as an agent (active) item of data type numeric (float).

    It works fine, except that every now and then, the system enters a state where the external command does not work for a while (it still runs, but does not report the information I need).

    Is there something the user parameter script can do (return a magic string, exit with a magic status code, etc.) that tells agent and server that no data is available? As far as I can tell from behavior, documentation and source, the exit code is ignored entirely and the output is forwarded to the server verbatim.

    The server then takes any non-numeric data as an excuse to set the item to unsupported and fires off a notification. Ten minutes later, the item comes back in, and I'm gonged at a second time by the "hey, it's back!" notification.

    If the user parameter stops working entirely and keeps returning this "null" result, I can catch that with a nodata trigger expression instead, and that gives me the option of controlling *when* unavailability becomes important. The "has become unsupported" notification either happens immediately or never (if I don't turn it on).

    Thanks,
    Christian
  • otheus
    Member
    • Mar 2009
    • 53

    #2
    Bump. I've complained about this since at least 1.8.

    Comment

    • dimir
      Zabbix developer
      • Apr 2011
      • 1080

      #3
      Since 4.2 you have a so called "Custom on fail" value preprocessing feature where you can e. g. ignore the "unsupported" status: https://www.zabbix.com/documentation...fig/items/item

      Comment

      Working...