Ad Widget

Collapse

Zabbix Custom Script Alerts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ellio
    Junior Member
    • Apr 2022
    • 4

    #1

    Zabbix Custom Script Alerts

    Hello,

    I was following the web site guide on passing parameters to a custom script.



    The only ones I could get working are the three that clearly say they are for alert script parameters as defined below.



    How can I pass things like IP address, Hostname, Event Severity, and Tags through to a custom script? Is there a guide somewhere I can look at to figure this out?

    Any help at all would be appreciated. I was looking through old posts and I found something similar but I can't find the screen in reference on Zabbix 5.4, when I go to the Actions page the only thing I can specify is who to receive notifications and through which media. Am I missing something on this action page? I know this post is old and we are using Zabbix 5.4 so maybe what I'm looking for is somewhere else?

  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    I think you're looking for the message template tab, for example:

    Problem started at {EVENT.TIME} on {EVENT.DATE}
    Problem name: {EVENT.NAME}
    Host: {HOST.NAME}
    Severity: {EVENT.SEVERITY}
    Operational data: {EVENT.OPDATA}
    Original problem ID: {EVENT.ID}
    {TRIGGER.URL}

    Comment

    • ellio
      Junior Member
      • Apr 2022
      • 4

      #3
      Yes, I can pass the whole message or the whole subject with the {ALERT.MESSAGE} or the {ALERT.SUBJECT} and that part works without issue. I could customize those to just have {HOST.NAME} or {HOST.IP} or whatever, but for my use case I need to pass 4 separate variables to my script and correlate each to an OID. I would like a way to pass just the {HOST.NAME} variable from Zabbix to my custom alert script without having to use the {ALERT.MESSAGE}

      Comment

      • ellio
        Junior Member
        • Apr 2022
        • 4

        #4
        If anyone else is curious I found a workaround, I just put in delimiters on the ALERT.MESSAGE put in what I needed for my OID's and used IFS to parse it in my custom script.

        Comment

        Working...