Ad Widget

Collapse

Usage of SNMP LLD Macros not possible in Discovery Trigger expressions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • herr
    Junior Member
    • Oct 2022
    • 2

    #1

    Usage of SNMP LLD Macros not possible in Discovery Trigger expressions

    I am trying to write a trigger that fires when an Interface on a switch goes down. Since I only want it to fire on certain interfaces, I've written a conditional that is supposed to evaluate to TRUE only when {#IFALIAS} has certain values. I am using the regexp() function to evaluate that. However, while this method does work on another trigger that uses a LLD Macro defined in the LLD Macros tab in the Discovery rule, it doesn't seem to evaluate at all when using a LLD Macro defined via SNMP OIDs. In fact, it doesn't even matter if I evaluate against anything (.*) OR negate the result. It seems as though the entire conditional silently fails.

    The expression I use is the following:

    Code:
    avg(/HP CX Switch SNMP/net.if.status[ifOperStatus.{#SNMPINDEX}],2m)=2 and {{#IFALIAS}.regexp("{$NET.IF.IFALIAS.WATCHED}")}=1
    The {$NET.IF.IFALIAS.WATCHED} Macro is a regular expression definable at the host or template level. Again, it doesn't even matter whether I replace it with something like ".*". And like I said, in another template "{IFALIAS}" (with a different name of course) is defined via a JSONPath variable in the LLD Macro tab.

    Any help getting this trigger to run correctly is much appreciated.
  • Markku
    Senior Member
    Zabbix Certified SpecialistZabbix Certified ProfessionalZabbix Certified Expert
    • Sep 2018
    • 1782

    #2
    See LLD overrides: https://www.zabbix.com/documentation...overy#override

    That will enable you to prevent creating triggers for interfaces that match your conditions.

    Markku

    Comment

    • herr
      Junior Member
      • Oct 2022
      • 2

      #3
      Ahh thanks. I finally managed to achieve this by way of these overrides. Pretty convoluted, if you ask me. And I had to re-create the hosts to actually achieve what I had in mind. But thanks nonetheless!

      Comment

      Working...