Ad Widget

Collapse

Extract string from macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mechanix
    Member
    • Jan 2017
    • 92

    #1

    Extract string from macro

    Hi,

    we have following working trigger:

    Name: Interface status on {HOST.HOST}: ge-0/0/1, {ITEM.VALUE2} : {ITEM.VALUE3}
    Expression: ({node1:ifOperStatus[ge-0/0/1].last(#4)}=1 and {node1:ifOperStatus[ge-0/0/1].min(#3)}=2 and {TRIGGER.VALUE}=0) or ({node1:ifOperStatus[ge-0/0/1].min(#3)}=2 and {TRIGGER.VALUE}=1)


    The interface name is discovered via template.

    Now we would like to use a the trigger action based on the interface name to execute a remote command on the server.

    {#SNMPVALUE} is used only during the discovery and I couldn“t find a way to pass it to the command as a argument:

    /usr/lib/zabbix/externalscripts/ansible-base/roles/local/ansible-zabbix2otrs/files/update_host_create_ticket.sh "{EVENT.TIME}" "{EVENT.DATE}\n" "{TRIGGER.NAME}\n" "{HOST.NAME}\n" "{#SNMPVALUE}\n" "{TRIGGER.SEVERITY}\n"

    How can I extract the interface name from the TRIGGER.NAME and pass it as a argument to the command? Regex maybe?

    Thanks
Working...