Testing our trigger expressions

We have seen so far that we can build triggers by hand and by selecting triggers from a list. What we have not seen yet is a way to test our triggers before throwing everything in production. In this recipe, we will show you how to test the triggers you have just created.

Getting ready

For this recipe, we will need as always our Zabbix server properly set up with a super administrator account. You should also be familiar with creating items and triggers. In this recipe we will make use again of the ping item that we have created in our recipe, Creating triggers.

How to do it ...

  1. Go back to the trigger that we have created for our item that was checking the availability of our host by making use of ping.
  2. Edit the trigger that we have created in our recipe, Creating triggers:
    How to do it ...
  3. Click on Expression constructor; you will now see a new box with our expression.
  4. At the left bottom of the box there is a small button named Test. Click on it and a new window will popup:
    How to do it ...
  5. As you can see we have our trigger expression and behind it a value of 1 or 0 that we can select. In our case, if ping is successful it will return a value of 1 and 0 if our ping fails.
  6. So select a value of 1 and 0 and press the Test button to check the outcome. If everything was created fine then 1 should return us the status True and 0 False.

How it works

With the expression constructor, it is easy to build more complex constructions but also to test our expressions. By faking a positive or a negative outcome of the input we can see what the outcome will be for our trigger. Zabbix will show us True or False to let us know what the output will be. This way, it is possible to test the triggers that we have build before putting them in production without knowing if they will work or not.

There's more...

We have seen in this chapter that the severity can be chosen for each trigger that we build. However, it is possible to rename them and to change the colors per severity. The GUI elements can be configured in Administration | General | Trigger severities. Users can also set audio alerts. Remember this was explained in Chapter 2, Exploring the frontend.

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

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