Ad Widget

Collapse

Script with macros as parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #1

    Script with macros as parameters

    I'm getting an error when trying to start manually a global script from Zabbix 5.0.

    Script command executed on Zabbix server:
    Code:
    /usr/lib/zabbix/externalscripts/rde/rde_criar.sh "{HOST.HOST}" "{HOST.IP}" "{HOST.NAME}" "{EVENT.NAME}"​ "{TRIGGER.DESCRIPTION}" "{ITEM.VALUE}" "{EVENT.SEVERITY}" "{EVENT.DATE}" "{EVENT.TIME}" "{EVENT.AGE}" "{EVENT.STATUS}" "{EVENT.ACK.STATUS}"

    ERROR:
    Code:
    [SCRIPT ERROR MESSAGE]
    Cannot execute script
    
    /usr/lib/zabbix/externalscripts/rde/rde_criar.sh "esbsa009908jc1" "" "esbsa009908jc1" "{EVENT.NAME}"​ "{TRIGGER.DESCRIPTION}" "{ITEM.VALUE}" "{EVENT.SEVERITY}" "{EVENT.DATE}" "{EVENT.TIME}" "{EVENT.AGE}" "{EVENT.STATUS}" "{EVENT.ACK.STATUS}"
    The error above shows that macros are not properly resolved.

    For Zabbix 5.0 I get this error.

    For Zabbix 5.4 it just works.

    Is there a parameter limit for Zabbix 5.0?


    Last edited by markfree; 25-11-2021, 15:59.
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    If I change the parameters order, I can see that only Host macros bellow are resolved.
    Code:
    "{HOST.HOST}" "{HOST.IP}" "{HOST.NAME}"
    That suggests me that the script is not receiveing event data.

    In Zabbix 5.0, I'm starting the script at the Dashboard "Problems" widget and "Host" column.
    But in Zabbix 5.4, I can start the script from "Problem - Severity" column.

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #3
      I think I found what's going on.
      Zabbix 5.0 does not support event macros for global scripts.
      In contrast, Zabbix 5.4 supports manual event action scripts.

      That's a bummer.

      Comment

      Working...