Ad Widget

Collapse

LLD, macro inside regexp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Dziugas
    Junior Member
    • Oct 2016
    • 3

    #1

    LLD, macro inside regexp

    Hi!

    I want to build triggers for snmptrap via LLD. Snmp function gives {#SNMPVALUE} macro. When I try to use it in trigger prototype, zabbix does not converts macro to value. How should I write regex with macro inside?

    Trigger prototype:
    ({TRIGGER.VALUE}=0 and {VSA-1:LH.MG.Hosts.[{#SNMPINDEX}].regexp()} = 1 and {VSA-1:snmptrap["lhnNsmNotificationManager"].regexp(^.*EID_.*STATUS.*DOWN.*{#SNMPVALUE}.*)}=1) or ({TRIGGER.VALUE}=1 and {VSA-1:snmptrap["lhnNsmNotificationManager"].regexp(^.*EID_.*STATUS.*UP.*{#SNMPVALUE}.*)}=1)

    Trigger:
    ({TRIGGER.VALUE}=0 and {VSA-1:LH.MG.Hosts.[1].regexp()} = 1 and {VSA-1:snmptrap["lhnNsmNotificationManager"].regexp(^.*EID_.*STATUS.*DOWN.*{#SNMPVALUE}.*)}=1) or ({TRIGGER.VALUE}=1 and {VSA-1:snmptrap["lhnNsmNotificationManager"].regexp(^.*EID_.*STATUS.*UP.*{#SNMPVALUE}.*)}=1)
  • jjahn
    Junior Member
    • May 2017
    • 7

    #2
    Did you ever get an answer to this? I am seeing the same issue. The #variable not being resolved in trigger prototype expression .

    This works

    {t_task_app_log:log[{#LOG},{#MATCH_REGEX},{#ENCODING},{#MAXLINES},{#MO DE},{#OUTPUT},{#MAXDELAY}].regexp("{"myregex")}=1

    but not this

    {t_task_app_log:log[{#LOG},{#MATCH_REGEX},{#ENCODING},{#MAXLINES},{#MO DE},{#OUTPUT},{#MAXDELAY}].regexp("{#ERR_REGEX}")}=1

    Comment

    Working...