Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Retrieve trigger action variables

$
0
0

Having been partly down this road when I built an alert validator, I think you could do the following:

 

  1. Retrieve the ObjectType from the Alert definition
  2. Retrieve the Trigger variables from the alert actions
  3. If the variable contains a "." (period) in it, assume it goes to another table.
    1. 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.
  4. 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}
  • ${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.


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>