[ZBX-11310] 'tag <>' event condition doesn't work Created: 2016 Oct 04  Updated: 2017 May 30  Resolved: 2016 Oct 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.0
Fix Version/s: 3.2.2rc1, 3.4.0alpha1

Type: Incident report Priority: Major
Reporter: Jacek konieczny Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: actions, tags
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-11488 Tag value <> in action condition does... Closed

 Description   

I want to use a different notification mail template for triggers with one and with two items (so I don't get the ugly UNKNOWN place-holders).

I tagged all my two-items triggers with tag '2items' and configured two actions:

  • 'Report problems to Zabbix administrators', condition: 'Tag <> 2items'
  • 'Report problems to Zabbix administrators (2 items)', condition: 'Tag = 2items'

Only the second action would ever be executed, the 'Tag <> 2items' never matches an event without any tags.

I took a peek into the source code and it seems that tag conditions are broken – the condition value is based on the first matching tag. It will never be 'SUCCEED' for event without any tags.



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2016 Oct 11 ]

If we read "Tag" as "event has a tag" and "<> 2items" as "which is not equal to '2items'" then it becomes logical and obvious that event with no tags does not match condition "event has a tag which is not equal to '2items'".

Comment by richlv [ 2016 Oct 11 ]

glebs.ivanovskis, that's a dangerous path
"application" condition would require an application, even when using "not like".
"template" condition would require at least some template when using "<>"

Comment by Jacek konieczny [ 2016 Oct 11 ]

And the documentation clearly states:

Specify event tag or event tag to exclude.
= - event has this tag
<> - event does not have this tag
like - event has a tag containing this string
not like - event does not have a tag containing this string

(from https://www.zabbix.com/documentation/3.2/manual/config/notifications/action/conditions)

Comment by Yaroslav [ 2016 Oct 17 ]

I agree. When I add tag<>"something tagname" to actions, it doesn't working with triggers without any tag.

Comment by Sergejs Paskevics [ 2016 Oct 18 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-11310

Comment by Andris Zeila [ 2016 Oct 25 ]

Successfully tested. Please review slight improvement in code readability (r63348).

Comment by Sergejs Paskevics [ 2016 Oct 27 ]

Fixed in:

  • pre-3.2.2rc1 r63376,
  • pre-3.3.0 (trunk) r63377
Generated at Fri Apr 26 19:00:21 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.