Ad Widget

Collapse

Trigger based on Trigers from another Hosts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luizfernandogondin
    Junior Member
    • Jul 2016
    • 9

    #1

    Trigger based on Trigers from another Hosts

    Dear all, I was looking for a way to make a trigger if at least one of 3 triggers from 3 different hosts is on.

    All of them are icmp itens that check for hosts availability and the goal is to create a map which will turn red if any of the checked itens become unavailable.

    The thing is I cannot create a trigger just by pasting the other 3 and using the "OR" statement since they aren't from the same template.

    Is that possible?

    btw, I tried to sum all ping results using a calculated item, since I thought that every ping result should return 1 (when it's reachable) and a calculated item from 3 hosts would return 3. But that just didin't work

    Would you guys give me a hand on that?

    Best regards,
    Luiz
  • valegator
    Junior Member
    • Jul 2016
    • 18

    #2
    Aggregation is key

    Your approach with calculated item is pretty similar to a possible solution:

    1. Create a pseudo host, name it e.g. "Zabbix_Statistics" with IP 127.0.0.1
    2. Create a host group where you put all your 3 hosts in, e.g. "RG:MapName"
    3. Create an item on pseudo host:
    Name: "Number of hosts in RG:MapName reachable"
    Type: "Zabbix aggregate"
    Key: grpsum["RG:MapName",icmpping,last]
    4. Create Trigger to created item, e.g.:
    Name: "Less than 3 Hosts in group RG:MapName reachable"
    Expression: "{Zabbix_Statistics:grpsum["RG:MapName",icmpping,last].last()}<3

    Comment

    • luizfernandogondin
      Junior Member
      • Jul 2016
      • 9

      #3
      Almost there

      Thanks for your reply Valegator!

      It indeed works! At first I thought that this solution would work but the trigger in the pseudo host would change it's status to "ON" if any other trigger in that host had it's status changed.

      Then after writing a (really) long reply asking you how to do it on an item level (instead of a host level) I realized that we can have only 1 icmp check per host!

      Now iam wondering if I wanted to do the same thing with a service check (a.k.a. net.tcp.port) how should I proceed?

      Best regards,
      Luiz

      Comment

      • luizfernandogondin
        Junior Member
        • Jul 2016
        • 9

        #4
        And I'm also trying this (since it's a template):

        grpsum[{HOST.NAME},icmpping,last] for the item key --not working

        The idea behind the macro is to have groups with the same name as the pseudo host and then nest everything that I want to check inside their groups.

        I found many people asking for this but it seems that what was once working is not anymore (At least in v3.0)

        Comment

        • valegator
          Junior Member
          • Jul 2016
          • 18

          #5
          Additional info

          Originally posted by luizfernandogondin
          we can have only 1 icmp check per host!
          You actually can have multiple icmpping items per host, just the key must not be the same. For example, if you already have an item with key "icmpping", you can add another item with key "icmpping[,3,,,]", which does the exact same thing. You can go as far as adding 10+ icmpping items, just by slightly adjusting the parameters. Same goes for every item which accepts custom parameters in its key.


          Originally posted by luizfernandogondin
          grpsum[{HOST.NAME},icmpping,last]
          This can't work, because you'd have to create a group equivalent to the "Host name" field in the host configuration and name every host you want in there the same. This would be neither practical nor would you have less effort.
          I'd recommend you create a new host group for each functional related group (e.g. SQL Cluster Nodes) after a naming concept, e.g. "RG:SQL_Clusters_Web" where RG stands for ResourceGroup.

          Then you just add an item to the template which would be something like grpsum["RG:SQL_Clusters_Web",icmpping,last] and link that template to Zabbix_Statistics.

          Originally posted by luizfernandogondin
          do the same thing with a service check (a.k.a. net.tcp.port) how should I proceed?
          You can add another item to the template you link to Zabbix_Statistics which would be somethink like grpsum["YourHostgroup",net.tcp.port,last].

          I'd recommend you the documentation on aggregated checks: https://www.zabbix.com/documentation...ypes/aggregate

          Comment

          • luizfernandogondin
            Junior Member
            • Jul 2016
            • 9

            #6
            Thanks Valegator! I thought that if I use the HOST.NAME macro I could save the effort to create the groups, which is basically the sabe as I will have creating the pseudo-hosts.

            I have to create 43 pseudo-hosts (with 3 different real hosts in each group to monitor). So, as I create each pseudo host, I'll be able to create a new group.

            Now, I can't see a way to apply a template that gathers the name of the group from the pseudo-host which iam applying the template and using it into the key and therefore into the trigger.

            To let things clear, I have 43 branch offices with 1 server and 2 links in each branch office. 43 servers and 66 links in total.

            What I did after the first reply is to create a pseudo-host named after the branch office's name and added the server and 2 links inside the same group.

            Doing it manually works great, but instead of creating the same item and trigger for every 43 branches, I decided to create a template and apply it only to the pseudo-host.

            What I understood later is that I couldn't have the group name inside the key, since they different for each one and now iam looking for a way to build it.
            Last edited by luizfernandogondin; 14-07-2016, 19:23.

            Comment

            • luizfernandogondin
              Junior Member
              • Jul 2016
              • 9

              #7
              anything guys?

              Comment

              Working...