SOLVED Weblogic 12c mail dynamic subject and body
-
Hi,
I’m currently using Weblogic 12c (12.1.3) which is working fine. I would like to send email notifications on startup or shutdown of the servers configured. In the notifications configuration part, I can see we can enter custom mail subject and body. Can you please let me know how to add the server name dynamically? As I’ll be using the same notification across multiple servers, I’ll need something to be dynamic.
For eg, in case of mail subject, is it possible to have like below?
Alert mail from ${hostname}
As highlighted in italics, do you support el expression or something like that. So that it picks some values dynamically? If so, Can you please share me the docs regarding the same?
And also do you support email templates for the same purpose? If yes, Can you please share the docs for that too?
Just FYI, I’m using only the Weblogic Admin console for now. As I have only access to that.
-
Hi,
Below metrics are working as your requested. They are getting server name values as dynamically. You don’t need to add specific configuration for that.
BACKEND MONITORING WARNING - ${SERVER_NAME}
HEALTH ALERT - ${INSTANCE_NAME}
HEALTH CLEAR - ${INSTANCE_NAME}So your second question, you can customize default alert emails for above options but there is no customize options in complete templete. If you can create your own devops mbean then you can create/customize HTML email. You can follow below doc.
Regards.
Create Devops MBean:
https://medium.com/wlsdmforweblogic/oracle-weblogic-linux-disk-usage-and-delete-action-a4328e8629fc -
@haydar-seyfi-wlsdmteam Thanks for the info. Variables like, ${SERVER_NAME} as you mentioned in your reply. Do you have any documentation for those ?. I’m asking like a complete list of all available variables.
Are these environment variables or the ones set by the Watcher thread in Weblogic 12c server ?.
I’m not interested in the environment variables in the system. I’m only interested in the values that are present at the time the notification kicks in. Like rule, domain name, server name, timestamp etc. as shown in the image attached. I want all possible values that can be retrieved while sending via email with custom body and subject
-
Hi,
This is customizable values that current values in WLSDM email.
If you need to new feature request you can create a new ticket as below page.Regards.
WLSDM new feature request/wishlist: https://community.wlsdm.com/category/7
Current customizable email features:
mail.content.backend.alert.subject
mail.content.backend.header.alert.message
mail.content.backend.header.alert.title
mail.content.global.external.console.url
mail.content.health.alert.subject
mail.content.health.clear.subject
mail.content.health.header.alert.message
mail.content.health.header.alert.title
mail.content.health.header.clear.message
mail.content.health.header.clear.title
mail.content.loginspector.alert.subject
mail.content.loginspector.header.alert.message
mail.content.loginspector.header.alert.title
mail.content.loginspector.logrecord.limit
mail.content.metric.alert.subject
mail.content.metric.clear.subject
mail.content.metric.header.alert.message
mail.content.metric.header.alert.title
mail.content.metric.header.clear.message
mail.content.metric.header.clear.title
mail.content.responsetimes.alert.subject
mail.content.responsetimes.header.alert.message
mail.content.responsetimes.header.alert.title -
@haydar-seyfi-wlsdmteam FYI I was referring to Weblogic 12c Admin Console UI. Specifically the below page where we setup SMTP properties.
So my question is, What are the possible variables can I refer in Custom Email Subject as shown above ?.
For eg, If I have AdminServer, ManagedServer1 and ManagedServer2. And when one of the managed server goes down and SMTP notification kicks in.
In email subject, I need to know what server went down
Subject: Alert!!! Server ${} is down
This info must be set in some variable right ?. I need the name of that variable.
I can’t simply say, Subject: Alert!!! Server ${SERVER_NAME} is down
Because I’m not sure if the SERVER_NAME variable is set by Weblogic at the time of sending the SMTP email notification.
So, if in case you have list of such variables I can use in Custom email subject (or) body, that would be really helpful.
Thanks and Regards,
Gowtham Alaguraj -
-
@haydar-seyfi-wlsdmteam Thanks for the info