Description of problem: It is not possible to create an alert which is fired when a datasource's 'Connection Available?' trait changes to 'no'. The alert can only be fired on a 'change', but you cannot specify that an alert should only be fired when the value changes to 'no'. This causes alerts to be fired when the 'Connection Availability?' changes to 'yes' as well, which is completely unnecessary (and not desired by operations teams). The 'Connection Available?' trait seems to be introduced because 'Availability' of a DS resource does not reflect whether a the ds can actually connect to the DB, it only shows whether the managed resource is available in JBoss. However, with this trait introduced, we still cannot properly alert when the DB is not reachable anymore (i.e. the same semantics as 'Availability Goes Down' on managed resources). I tried to work-around the problem by defining an alert on a 'Connection Available?' change, and have that alert execute the operation 'testConnection'. Next I defined an alert on 'testConnection' operation to send a notification (e-mail) on a failure of that operation. However, this does not work either, because the return status of the 'testConnection' operation will be 'SUCCESS', even when a connection cannot be created. It's the 'result value' that will report 'false', but you cannot define an alert on operation result values either. Version-Release number of selected component (if applicable): JBoss Operations Network 3.1.1 How reproducible: Create an alert on 'Connection Available?' trait change and set an e-mail notification. Kill connection to DB, a notification e-mail will be sent. Restore the connection to the DB, a notification e-mail will be sent as well (which is not desired).
It seems to me that enhancing alerting to support a pattern for the new trait value could be useful in general. I'll take that approach.
Changed bugzilla name to better reflect the resultof the BZ. original: "Cannot fire alert on datasource "Connection Available?" trait changing to value 'no' (only on value change in general)."
master commit 4d5117af409b27b39ebdfe1283c72eff967863f9 Author: Jay Shaughnessy <jshaughn> Date: Mon Apr 15 16:36:35 2013 -0400 Trait Change alert conditions now optionally support a regex matching test for the new value. If omitted the alert condition is unchanged from prior behavior, the alert condition matches if the trait value changes. If provided, the alert condition matches if the trait value changes and if the new value matches the regex pattern. Existing alert definitions are unaffected. Also: - a little cleanup of relevant I18N messages
As this is MODIFIED or ON_QA, setting milestone to ER1.
verified in jon 3.2 er4 alert fired and notificaiton sent only for "false" connection condition. connection getting back dosn't create new alerts and notifications. please get attached email notoficaiton.
Created attachment 819229 [details] alert