Creating triggers

Now that we have an item successfully gathering data, we can look at it and verify whether it is reporting as expected (in our case, that the system is not overloaded). Sitting and staring at a single parameter would make for a very boring job. Doing that with thousands of parameters doesn't sound too entertaining, so we are going to create a trigger. In Zabbix, a trigger is an entry containing an expression to automatically recognize problems with monitored items.

An item alone does nothing more than collect data. To define thresholds and things that are considered a problem, we have to use triggers.

Navigate to Configuration | Hosts, click on Triggers (next to A test host), and click on Create trigger.

Here, only two fields need to be filled in:

  • Name: Enter CPU load too high on A test host for last 3 minutes
  • Expression: Enter {A test host:system.cpu.load.avg(180)}>1

It is important to get the expression correct, down to the last symbol. Once done, click on Add at the bottom. Don't worry about understanding the exact trigger syntax yet; we will get to that later.

Another way to create the expression is to click Add, create the correct condition by selecting the item and function, and filling in the Last of (T) and N fields, as in the following screenshot:

Notice how our trigger expressions refer to the item key, not the name. Whenever you have to reference an item inside Zabbix, it will be done by the item key.

The trigger list should now be displayed with a single trigger—the one we just created. Let's take a look at what we just added: open Monitoring | Overview and open the filter if it is closed, and then press the Any button. You should see our freshly added trigger, hopefully already updated, with a green color, as in the following screenshot:

With Zabbix 4.0, we now have the possibility to filter for Recent Problems, Problems, and Any in the filter. With older versions, we had to look to the trigger page, where we would have a mix of filters in an OK and a problem state. Click on Filter to close the filter. We will explore this filter in more detail later.

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

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