Bug #41310 editing a rule with an empty threshold fills logs and breaks the events page
Submitted: 8 Dec 2008 21:18 Modified: 13 Jan 2009 16:57
Reporter: Sloan Childers Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Server Severity:S2 (Serious)
Version:2.0.0.7122 OS:Any
Assigned to: Darren Oldag CPU Architecture:Any

[8 Dec 2008 21:18] Sloan Childers
Description:
When altering an existing rule you must add an empty string "" to any threshold level that is empty or the rule will fail to run and resulting exceptions can cause the events page to be unusable due to duplicate key exceptions.

How to repeat:
Alter the agent not reachable rule as follows:

(CURTIME() NOT BETWEEN '02:00:00' AND '05:30:00' && %agent.reachable% = THRESHOLD)

Suggested fix:
If a threshold is empty at evaluation time insert an empty string into the expression so we don't fail on rule execution.
[10 Dec 2008 20:34] Darren Oldag
fixed the rule evaluator to change ALL 'variables' to the expected
evaluator format.  this includes the threshold, which must be turned
to the empty string "" string for NULL or empty thresholds.

tests were added at the expression evaluator level to to shore up
the expectations of their String data variable representations.

fix has been pushed to trunk.  awaiting review and push to 2.0.1 maintenance tree for build and release.
[16 Dec 2008 19:00] Darren Oldag
pushed to 2.0 maintenance branch, awaiting build.
[18 Dec 2008 19:21] Bill Weber
verified fixed in build 2.0.2.7126
[13 Jan 2009 16:57] Tony Bedford
An entry was added to the 2.0 changelog:

When altering an existing rule you had to add an empty string, "", to any threshold level that was empty. Otherwise, the rule failed to run and the resulting exceptions caused the Events page to be unusable due to duplicate key exceptions.