Ad Widget

Collapse

Item based off other Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jmart
    Junior Member
    • Jun 2016
    • 8

    #1

    Item based off other Item

    I want to setup a trigger based off of two items. The first item is ICMP of the machine and the secdon is ICMP ping of the gateway. I created a custom item that will give me the gateway IP address but have not figured out a way to create another item that can use that ip address. Is this possible or do any of you have a better way to accomplish this.

    First item:
    Template:Testing
    Name:GatewayIP
    Key:linux.gateway.ip

    Second Item:
    Template:Testing
    Name:GatewayPing
    Key:icmpping[{Testing:GatewayIP.last(0)}]
    Last edited by Jmart; 30-08-2016, 13:32.
  • Jmart
    Junior Member
    • Jun 2016
    • 8

    #2
    I have tried several different combinations to get this working but cannot get it figured out.

    A little more information:

    First item:
    Template:Testing
    Name:GatewayIP
    Key:linux.gateway.ip
    Result = 10.10.1.1

    Second Item:
    Template:Testing
    Name:GatewayPing
    Key = icmpping[{Testing:GatewayIP Address.last(0)},1,20,24,50]
    Result= fping failed: '{Testing:GatewayIP address not found
    Last edited by Jmart; 31-08-2016, 14:10.

    Comment

    • peatb
      Zabbix Certified Trainer
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Aug 2016
      • 36

      #3
      You can't use one item as source for another item in the way you're trying. You can solve it in a different way though:
      Create a Low Level discovery that checks the gateway and use that to create the ping item.
      See https://www.zabbix.com/documentation...evel_discovery

      Comment

      • Jmart
        Junior Member
        • Jun 2016
        • 8

        #4
        THANK YOU..

        Ok so i created a new custom item with this:

        echo {\"data\":[{\"{#GATEWAYIP}\":\"$(route -n | perl -lane 'print $F[1]' | head -3 | tail -1 | grep -v "0.0.0.0" | grep -v "IP" | grep -v "Gateway")\"}]} | python -m json.tool


        Then i created a discovery for it and a item.
        now im waiting for the data poll and see if it works.
        UPDATE:
        Works perfect!
        It would be easier if we can just use a item in another item but ohh well, i got to learn all about json.
        Last edited by Jmart; 31-08-2016, 15:33.

        Comment

        Working...