Ad Widget

Collapse

How to use item name in trigger expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bbs2web
    Junior Member
    • Apr 2016
    • 22

    #1

    How to use item name in trigger expression

    I got allot of notifications from my router's WiFi interface as it transitions operational state when there are no clients connected.

    I wanted to change the trigger expression to only match when the interface name didn't start with 'wlan' but Zabbix won't accept my changes:
    Code:
    and {"{#SNMPVALUE}".regexp(^wlan)}=0
    Would anyone have a suggestion on how to achieve this? The '{#SNMPVALUE}' marco expands to 'wlan1 - 5.4GHz' or 'wlan2 - 2.4GHz'.
  • bbs2web
    Junior Member
    • Apr 2016
    • 22

    #2
    [SOLVED] Use item

    Got it working by storing the ifDescr in an item and then evaluating that in the trigger expression. Additionally use a trick to obtain the ifAlias to obtain the interface description for trigger action notifications.

    Title:
    Int. {#SNMPVALUE} ({ITEM.VALUE2}) on {HOST.NAME} operational status changed

    Trigger expression:
    {Template SNMPv2 Interfaces:ifOperStatus[{#SNMPVALUE}].diff(0)}=1 and {Template SNMPv2 Interfaces:ifAlias[{#SNMPVALUE}].str(this_does_not_exist)}=0 and {Template SNMPv2 Interfaces:ifDescr[{#SNMPVALUE}].regexp(^wlan)}=0

    Comment

    Working...