Ad Widget

Collapse

String Compare to lost Value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dl4ner
    Junior Member
    • Aug 2017
    • 1

    #1

    String Compare to lost Value

    Hi,

    I'm struggling with this:

    I have a setup where I do a low level discovery via SNMP for ipsec tunnels.

    I can correctly discover the ip addresses and add triggers to those discovered tunnels that give me a trigger if a SNMP tunnel goes down

    the trigger prototype looks like this:

    Name: Lost Tunnel {HOSTNAME} to {#SNMPVALUE}
    Expression: {Tunnels:myIpsecipaddresoid[{#SNMPVALUE}].nodata({$TUNNEL_DOWNTIME})}

    this does work quite well.

    Now:
    I would like to have special tunnels with special names, so if #SNMPVALUE is the IP of headquater, I want to have the Tunnel named "Lost tunnel {HOSTNAME} to HQ". Manually renaming the tunnels after creation is no option as we consider 80..100 locations with 3..5 tunnels each.

    I understand I cannot use comparisms in Name, so the idea would be to have something like a trigger for each tunnnel named "Lost tunnel to HQ", but in the expression I would check if the IP adress of that tunnel matches a Variable.
    something like
    ... and {Tunnels:myIpsecipaddresoid[{#SNMPVALUE}].str({$HQ_IP})} = 1

    The problem here seems to be:
    if Tunnels:myIpsecipaddresoid delivers nodata(), then the Object is gone, and the above comparism must fail.

    I would be glad if I coud do something like "#SNMPVALUE == $HQ_IP",
    as #SNMPVALUE translates during low level discovery to the IP in form of "1.2.3.4", so then I could compare "{$HQ_IP}" to "1.2.3.4".

    another possibility would be using the last well-known value, something like
    {Tunnels:myIpsecipaddresoid[{#SNMPVALUE}].last_known_good().str("...")} = 1
    but I could not find a function for last_known_good value.

    any pointers in which direction I should look? maybe I just used the wrong keywords for search, but neither google nor search in this forum did provide a result.

    kind regards,
    Werner
Working...