Trigger constructor

Of course, building triggers is nice but it would not be helpful if we had to memorize all possible functions. For this, we can make use of the trigger constructor in Zabbix. The constructor will show us a list where we can choose from and easily modify it to our needs.

Getting ready

To be able to do this recipe, you need a Zabbix server with super administrator access such as the standard admin account that came with the installation. We also need a network device that we can monitor in Zabbix.

How to do it...

  1. Our first step is to create a simple check. Our simple check will launch a ping command to our host. As host, you can choose any network device that is pingable. If you don't know how to do this, I suggest you go back to Chapter 4, Monitoring with Zabbix and check out the recipe, Simple checks. Just a basic ping check will do. There is no need to add special options to the item.
  2. Go to your host. This can be done from the menu Configuration | Hosts and click there on Triggers.
  3. Fill in the Name field. example. Zabbix agent on {HOST.NAME} is unreachable for 5 minutes. You see in the name {HOST.NAME}, this is a macro that will tell us the hostname when the trigger launches. This will make our life very easy when we get notified later about potential issues.
  4. Now instead of typing in the expression, we click on the Add button on the right side of the Expression box.
    How to do it...
  5. We press the Select button and another window will pop up where we can select the correct item from our host or template that we will use to build our trigger on.
    How to do it...
  6. Once you have select the correct trigger, fill in the Function. You will also see a drop down list to choose from.
  7. For the Last of (T) option, we fill in 5m, because we only want to be notified once the machine is unreachable for 5 minutes.
  8. And for N we place 1, because our ping will return 1 if all is fine and 0 when there is a problem.
  9. Now our trigger is ready to use.

How it works

Just like in the previous recipe, we have built the same trigger but we made use of the expression builder that is integrated in Zabbix. This will make building complex triggers easier.

There's more

When you click on the Expression constructor, some new boxes will pop up under the Expression box. You will see the box And, Or, and Replace. It is possible now to combine two or more expressions with And and Or to help you out in more complex situations.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.226.105