[ZBX-9943] formula for action with "Custom expression" not updated after condition deletion - Breaks action Created: 2015 Oct 07  Updated: 2022 Oct 08

Status: Confirmed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Documentation (D), Frontend (F)
Affects Version/s: 2.4.5
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Larry Dorman Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: actions, customexpression, delete, documentation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

vanilla Zabbix, MySQL db, linux (oel 6)


Issue Links:
Duplicate
is duplicated by ZBX-10363 Zabbix actions with an invalid custom... Closed

 Description   

1) Create trigger action with a custom expression such as "A and (B or C or D or E) and F and G and H and I" where B, C, D, and E are templates.

2) Delete template referenced by D

Custom expression does not get automatically updated. That action will now fire for a variety of events that have nothing to do with the trigger. One must find and update the custom expression manually to get the action to quit firing.



 Comments   
Comment by Oleksii Zagorskyi [ 2015 Oct 08 ]

Related issue ZBXNEXT-551.
Current issue description does not contain all details, I mean that action disabled automatically too, as it should (documented in ZBX-7948).

Key point here is custom expression.
I can reproduce it on frontend 2.4.7rc1.
Simpler custom expression to reproduce is "A and B and C" where one of them is template/host or probably any other entity type, documented in https://www.zabbix.com/documentation/2.4/manual/config/notifications/action/conditions#actions_disabled_due_to_deleted_objects.

Even if you have custom expression with two members only "A and B", then deleting one of them leaves the custom expression unmodified in database (actions.formula) but it's not visible in frontend because with single condition, "Type of calculation" settings are not displayed at all and it's even worse.

Hard to decide how it could be improved for custom expressions.
If fix expression automatically- which and|or to remove? before or after removed reference (if both exists)?
It could be possible, when and|or are before or after reference only. Or when C reference has identical "and" or "or" on both sides, like "... and C and ..." or "... or C or ..."
But if for example we remove D from "... and D or ...", what should be removed with D "and" or "or"? Good question ....

If not fixed in code - then have to be additionally documented, definitely.

Server side was not tested.

CONFIRMED.

Comment by Larry Dorman [ 2015 Oct 08 ]

Prohibiting removal of templates used in custom expressions would put the burden on the admin and protect the system.

Comment by James Cook [ 2016 Feb 09 ]

I think things can be solved / prevented here by:

  • As mentioned above by preventing objects being deleted that are involved with actions
  • Do not allow the enabling of actions via the actions list status toggle that have invalid custom expressions or as I experienced many events actions were invoked.
Generated at Fri Apr 26 08:04:32 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.