Ad Widget

Collapse

Injecting Dynamic Data into Discovered Trigger Names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smichaelt
    Junior Member
    • Jun 2018
    • 1

    #1

    Injecting Dynamic Data into Discovered Trigger Names

    Hi There,

    Currently working with Zabbix 7 and trying to enhance our monitoring for BGP peers. I am using low-level discovery to dynamically discover BGPv4/v6 peers and their associated ASN numbers.
    I aim to dynamically inject a BGP description (retrieved from an external source) that doesn't offer an OID, into the trigger names or maybe the trigger desc.

    The BGPv4 discovery rule basically applies to a Cisco CSR hosts (routers) and consists of the following SNMP OID, meaning it knows to link the ASN name to the discovered peer IP.

    discovery[{#SNMPASN},.1.3.6.1.4.1.9.9.187.1.2.5.1.11.1.4]
    Here's what I’ve done so far:
    • Item Discovery
      I have created a trapper item for each discovered ASN using the following key:

      bgp.peer.description[{#SNMPASN}]
      This item stores the description of the ASN, which is pushed to Zabbix via the API every few hours.
    • Trigger Discovery
      I have a trigger prototype that detects when a BGP peer goes down. The trigger name follows this pattern:

      BGPv4 peer {#SNMPINDEX} ASN {#SNMPASN} is DOWN
    • Now the goal isto dynamically inject the BGP peer description from the "bgp.peer.description[{#SNMPASN}]" item into the trigger name or trigger description. Ideally, I would like the trigger name to look something like this:

      BGPv4 peer X.X.X.X ASN 1299 (IPT:Arelion) is DOWN
    What I’ve tried:
    1. Using Macros: I tried modifying the trigger name to use a macro like {$BGP_PEER_DESC_{#SNMPASN}}. However, this approach does not work with nested macros.
      It resulted in the following, although the macro was properly there under the host.

      BGPv4 Peers Discovery: BGPv4 peer X.X.X.XASN 1299 {$BGP_PEER_DESC_1299} is DOWN
    2. Using {ITEM.LASTVALUE}: I tried using Zabbix's {ITEM.LASTVALUE} function in the trigger description:

      BGPv4 peer {#SNMPINDEX} ASN {#SNMPASN} is DOWN.
      Peer description: {ITEM.LASTVALUE:bgp.peer.description[{#SNMPASN}]}
      But similarly to the trigger name, this doesn't seem to resolve the item values, and I end up with a description like this:

      BGPv4 peer X.X.X.X ASN 174 is DOWN.
      Peer description: {ITEM.LASTVALUE:bgp.peer.description[174]}
    3. API-based Trigger Updates: I also tried using the Zabbix API to update the discovered trigger names after discovery using a script. Unfortunately, discovered triggers cannot be updated via the API:

      { "jsonrpc": "2.0", "error": { "code": -32500, "message": "Application error.", "data": "Cannot update "description" for a discovered trigger" }, "id": 3 }
    Bottom line, I'm a bit frustrated and not sure what else can be done to achieve it.
    It seems impossible to link a trigger (in its name) with a specific ASN to an item value with the same ASN.
    What is the best way to dynamically inject the BGP peer description into the trigger name or message, given that it is discovered alongside the ASN? Are there any approaches or workarounds that I might have missed?

    Any help or guidance on how to tackle this would be greatly appreciated!
    Thanks in advance.
Working...