Bug 906385 - [RFE] Trait change alert conditions should support value expression
Summary: [RFE] Trait change alert conditions should support value expression
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Monitoring - Alerts
Version: JON 3.1.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ER01
: JON 3.2.0
Assignee: Jay Shaughnessy
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-31 14:51 UTC by Duncan Doyle
Modified: 2014-01-02 20:35 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-01-02 20:35:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
alert (105.12 KB, image/png)
2013-11-04 15:50 UTC, Armine Hovsepyan
no flags Details

Description Duncan Doyle 2013-01-31 14:51:23 UTC
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).

Comment 2 Jay Shaughnessy 2013-04-12 20:08:53 UTC
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.

Comment 3 Jay Shaughnessy 2013-04-15 20:00:36 UTC
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)."

Comment 4 Jay Shaughnessy 2013-04-15 20:39:12 UTC
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

Comment 5 Larry O'Leary 2013-09-06 14:32:42 UTC
As this is MODIFIED or ON_QA, setting milestone to ER1.

Comment 6 Armine Hovsepyan 2013-11-04 15:48:18 UTC
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.

Comment 7 Armine Hovsepyan 2013-11-04 15:50:41 UTC
Created attachment 819229 [details]
alert


Note You need to log in before you can comment on or make changes to this bug.