Ad Widget

Collapse

Scripts that return "ZBX_NOTSUPPORTED" no longer considered unsupported in Zabbix 7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neebygoosay
    Junior Member
    • Jul 2023
    • 3

    #1

    Scripts that return "ZBX_NOTSUPPORTED" no longer considered unsupported in Zabbix 7

    Before upgrade from Zabbix 6 to 7 I used the poorly documented feature of returning "ZBX_NOTSUPPORTED" in my custom scripts to let Zabbix server know that something wrong has happened to the item and it must switch to unsupported state instead of treating script's output as data.

    Recently I was working on a new custom script and noticed that this no longer works: when my scripts return "ZBX_NOTSUPPORTED" Zabbix treats that as valid data in string format instead of displaying an error.

    So, what's the trick to make it work in 7.0 ?
    The usecase is the following: when an LLD script misbehaves it must signal to Zabbix server that its output is garbage and not to be treated as data.
    Similarly, when a custom script used by Zabbix agent misbehaves, it must signal to server that it's now in unsupported state.

    Steps to reproduce:
    1. Create a new Discovery Rule with Type=Zabbix agent, Key=dummy;
    2. In Zabbix agent settings define a new UserParameter=dummy,/path/to/script.sh, restart agent to apply the change;
    3. Create a new bash script that does the following and make it readable and executable by Zabbix:
    echo "ZBX_NOTSUPPORTED"; exit 1
    4. In Zabbix server GUI open the discovery rule and press "Test", then "Get value and test".

    Expected result:
    There is a red banner on top of the Test item menu that reports that an error has occured;

    Observed result:
    The Value is populated with "ZBX_NOTSUPPORTED", - the string returned by the script is treated as valid data instead of an error signal.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    If you wanted a bug report, then you posted in wrong place .. https://support.zabbix.com/projects/ZBX is for bug reports..
    But I think it is not a bug, but change in protocol.. https://www.zabbix.com/documentation.../activepassive

    Comment

    • neebygoosay
      Junior Member
      • Jul 2023
      • 3

      #3
      Raised bug report at https://support.zabbix.com/browse/ZBX-26383 .

      If this is indeed a consequence of the new agent protocol then there must be a clear explanation in the docs on how to use it to indicate to Zabbix that an error occurred.
      If I have to guess from just reading the article 2 Passive and active agent checks I would think that they made it impossible in 7.x since the developers of custom scripts cannot influence agent to insert values into "data":[{"error": xxx }] rather than "data":[{"value": xxx }] , but I still hope that they simply forgot to document what the new approach is, because it's an essential feature!

      Comment

      Working...