Bug 1145101

Summary: Email alert notification field 'Condition' contains characters which are not part of defined condition
Product: [JBoss] JBoss Operations Network Reporter: Filip Brychta <fbrychta>
Component: Monitoring - AlertsAssignee: Jirka Kremser <jkremser>
Status: CLOSED CURRENTRELEASE QA Contact: Filip Brychta <fbrychta>
Severity: medium Docs Contact:
Priority: unspecified    
Version: JON 3.3.0CC: jkremser, jshaughn
Target Milestone: ER05   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:03:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Description Flags
email none

Description Filip Brychta 2014-09-22 11:40:00 UTC
Created attachment 939976 [details]

Description of problem:
See attached screen shot. Following characters @@@ should not be part of the condition.

Version-Release number of selected component (if applicable):
Version :	
Build Number :	

How reproducible:

Steps to Reproduce:
1. enable event log on platform resource
   a) go to resource's Inventory->Connection Settings
   b) add a file event log
2. add an alert definition with condition 'Event Detection' and notification 'Direct Emails' 
3. edit the event log file to invoke event which will fire defined alert
4. see received email

Actual results:
The email contains following line:
Condition 1: Event With Severity [INFO] Matching Expression "@@@"

Those '@' characters are not part of defined Regular Expression (it was empty)

Expected results:
Condition 1: Event With Severity [INFO]

Additional info:
When you actually use some Regular Expression in condition the result is following:
Condition 1: Event With Severity [INFO] Matching Expression ".*someString.*@@@"

You see that @ characters are still there but original expression was .*someString.*

Comment 1 Jirka Kremser 2014-09-22 12:26:54 UTC
This bug is related to bug 1070257

I think it is because of the fact we use '@@@' as a delimiter/meta-symbols on 2 places

1) as a separator between eventDetailsRegex and eventSourceRegex
2) as a placeholder in modules/enterprise/server/jar/src/main/resources/alert-email-template.txt


Comment 2 Jirka Kremser 2014-09-22 17:00:19 UTC
branch:  master
link:    https://github.com/rhq-project/rhq/commit/5e412d56b
time:    2014-09-22 18:57:49 +0200
commit:  5e412d56bd3a61f3794f1959e8ce35d7beb47893
author:  Jirka Kremser - jkremser@redhat.com
message: [BZ 1145101] - Email alert notification field 'Condition' contains
         characters which are not part of defined condition - Changing
         AlertManagerBean.prettyPrintAlertCondition() method to
         incorporate the changes in alert condition instance for events
         (the option field is used to carry two regular expression; one
         for the event details and one for the event source path).

Jay, could you please do the cherry-pick?

Comment 3 Jay Shaughnessy 2014-09-22 20:22:04 UTC
Release/jon3.3.x commit 897a8b3165baed336304f5c2d2f2de1cbce83efb
Author: Jirka Kremser <jkremser@redhat.com>
Date:   Mon Sep 22 18:57:38 2014 +0200

    (cherry picked from commit 5e412d56bd3a61f3794f1959e8ce35d7beb47893)
    Signed-off-by: Jay Shaughnessy <jshaughn@redhat.com>

Comment 4 Simeon Pinder 2014-10-21 20:24:28 UTC
Moving to ON_QA as available to test with the latest brew build:

Comment 5 Filip Brychta 2014-10-22 11:51:57 UTC
Verified on
Version :	
Build Number :