Ad Widget

Collapse

Conditionals inside Action messages?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eger
    Member
    • Nov 2006
    • 95

    #1

    Conditionals inside Action messages?

    I did not see this mentioned anywhere when searching. But I would liek to make more detailed messages based on conditionals.

    For example, some of my triggers have comments. Rather than just put {TRIGGER.COMMENTS} in the message I would rather it only show if it existed:

    if (isset({TRIGGER.COMMENTS}) { echo {TRIGGER.COMMENTS} };

    Something like this pseudo PHP code.

    Just a thought to make action messages a little more clean.

    If anyone has a suggestion on how to achieve this currently I would like to hear
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    and why can't you just use {TRIGGER.COMMENTS}, which would have the same effect as your 'if' statement ?
    nothing will be printed if the trigger has no comment
    Zabbix 3.0 Network Monitoring book

    Comment

    • eger
      Member
      • Nov 2006
      • 95

      #3
      I wanted to be able to change or add additional text if there were comments. But I guess for now the best way to format the email is to word it in such a case that looks correct with or without the comments line.

      Comment

      • richlv
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2005
        • 3112

        #4
        while that would addmore functionality, i'm not sure the added complexity would be worth it. indeed, currently your best choice is wording messages so that they make sense
        Zabbix 3.0 Network Monitoring book

        Comment

        Working...