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...