In Foglight 5 we used the out-of-box Action Parameters 'mail.subject' and 'mail.message' to be included in our Foglight Transaction Recorder (FTR) email alarms (see the Additional Information section for more details). However, the FTR Rules' email alerts are not coming through. Foglight could not evaluate the expression set for the mail.subject line, and was giving null for the mail.message line. We are seeing these errors below in the log file. What is wrong with what we had set for the mail.subject and mail.message? We had just selected from the default options presented to us.
You cannot just call an Expression directly into the email subject line or email message body; the Expression has to be loaded into another variable type (Message rather than Expression) first.
See the screenshots (first four screenshots) attached to this Solution.
1. Go to the Severity Level Variables tab under the Conditions, Alarms & Actions tab. See there that you can also select the Type to be Expression.
2. Set up our own special errorCode and errorMessage there as an Expression that uses groovy code.
3. In myemailsubject and myemailmessage variables that you define as a Message, call the errorCode and errorMessage Expressions by using the @ symbol.
4. Now that you have those Message-type variables, you can call them into your email message subject and body (screenshots 5 and 6).
Below is the exact instructions for what we tried to configure:
1. In the FMS web console under 'Dashboards' go to 'Administration' | 'Rules & Notifications' | 'Manage Rules'
2. Click on, for example, the rule 'FTR Agent Messages' to edit it.
3. Click the 'Conditions, Alarms & Actions' tab.
4. Open up, for example, the 'Critical' dropdown.
5. Click the 'Action' tab.
6. In the 'Action' dropdown box, select "EmailAction"
7. Click the 'Add' button
8. You'll see a list of 'Action Parameters'
9. Scroll over to the right to expose a vertical scrollbar and then scroll that one down to the very bottom.
10. For 'mail.messsage' (this will be the email's body), click on the 'Default' link (this is its' value, undefined by default).
11. The 'Action Parameter Editor' pops up
12. Highlight 'errorMesssage', a 'Rule/System Variable' and click on the 'Change' button. This will make 'mail.messsage' equal to 'errorMesssage', which in turn is equal to: