Event tags

Event tags are another way to get information in Zabbix and, besides the extra information, they help to close items in Zabbix in an automated way. Let's build on the previous task where we monitored and closed a log file with the recovery expression. 

Another way to close our item can be by using tags. Remember, we can add tags to our triggers. By adding the log tag here and giving it the {ITEM.VALUE} value, the value will be added from the item in our tag. This will be, in our case, error or ok. Since we only want to close it when we receive the ok value, we have to filter for the word ok. This we can do with the regsub function. So, if we bring all this together in our trigger, then we need to select the following options:

  • OK event generation: Expression
  • OK event closes: All problems if tag values match
  • Tag for matching: log
  • Tags: In the first box, add, log, and in the second box, {{ITEM.VALUE}.regsub(ok)}

In this case, when the tag matches the ok value, our trigger will be closed. 

What we see here is that the tag log gets populated with the latest values retrieved from our item and by making use of the regular expression function, regsub, we're able to extract the word ok from it.

Because we selected the OK event closes option with the log tag, the trigger gets closed automatically when the item receives the ok value in the log.

We'll see all of the tag information in our triggers in the dashboard, problem page, and so on. This can be useful as well. You could, for example, tag a program with the tag service and give the tag the name of the service, so that if the application is stopped, people know what service to restart.
Be careful not to select OK event closes: All problems if tag values match by not adding a tag in the Tags box, as this will result in the trigger being closed when the log gets populated with the next line.
..................Content has been hidden....................

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