Having been partly down this road when I built an alert validator, I think you could do the following:
- Retrieve the ObjectType from the Alert definition
- Retrieve the Trigger variables from the alert actions
- If the variable contains a "." (period) in it, assume it goes to another table.
- Parse apart the variable and use a switch / case statement to go back into the db and get the variable value from the other table.
- If the variable doesn't contain a ".", assume it comes from the table associated with the ObjectType from the Alert definition.
Example:
- Alert definition for my "MONITORING : Orion Application not UP" alert
- ObjectType = APM: Application
- pre-translate "APM: Application" into "APM_Application" (the actual table in the DB)
- Trigger action linked to this alert = send email
- email subject line is:
- ${Name} on ${Node.Caption} is ${Availability}
- email subject line is:
- ${Name} has no period in the name and therefore comes from Application custom properties
- ${Availability} has no period in the name and therefore comes from Application custom properties
- ${Node.Caption} has a period in it so go somewhere else
- split apart the variable name into $table , $column
- Goto $table and get value of $column
Rinse and repeat for other variables and parts of the alert action.
Sorry about the colouring of the text. I was doing copy-n-paste from my web-app.
Chris.