Hi,
We have set up an APP_Group custom field and we group the applications by this. Is it possible that these custom fields can be used as a variable in alerts as I can't see how to do it?
Cheers,
Kenny
Short answer, "yes"
Medium answer: if that's in the nodes table, you can refer to it as ${node.APP_Group} - note that in the alert variable, the "nodes" table is called "node" instead.
If you have it in the application table then the answer is still "yes" BUT how you get there depends greatly on what type of alert trigger you are using - APM_Application, APM_Component, custom SQL, etc.
Can you give a screen shot of the trigger and tell us where the custom field is?
I believe i know what you're asking for.. So i will give you a quick example and i'll let you make the decision. We use custom properties to group together subsets of servers into "Applications". When an alert is generated we wanted to be able to include which applications were affected when a server went offline.
Within alert manager, when setting up trigger actions like Send Email or Page, beneath the message tab there is "Insert Variables". Once you clicked on it.. I noticed that you were able to include Custom SQL Queries.
There is a hard fast rule when inserting variables provided by custom sql queries. You are only allowed to return one result. This complicated matters for us because some servers going offline could affect multiple applications. After a couple hours of playing around and testing, i exploited some sql commands to pull this off. Here is a working example for our system.
SELECT STUFF((SELECT DISTINCT oaac.AppName + CHAR(10) AS 'data()' FROM APM_ApplicationCustomProperties AS oaac INNER JOIN APM_Application AS oaa ON oaac.ApplicationID = oaa.ID WHERE (oaa.NodeID = ${NodeID}) AND (oaac.AppName IS NOT NULL) FOR XML PATH('')), 1, 0, '') AS Concatenated_rows
Small explanation, OAAC refers to the Orion APM Application Custom Properties tables. AppName is a custom variable we created with the applications name. Very general type of sql query stuff. The trick is the SELECT STUFF, FOR XML PATH, and AS CONCATENATED_ROWS.
When executed, we need up with
Affected Applications: Application1,Application2,
My only gripe.. i couldn't remove the trailing "," but what ever
Hope this helps and is something you were looking for.
Are you simply trying to include this information as part of your alert notification, or are you trying to utilize this information as criteria for triggering the alert?
The screenshots are attached. What I want to do is rather than specify a specific application group (custom field) in screenshot1 - App_group is equal to BigHand, I want to remove this and report the application group name in the alert email. As you can see if screenshot2 I have hardcoded the Application name. This should be the APP_Group name instead. That way I can get away with just one alert for all the apps.
kgrue,
This is what my example provides.
I have one single Alert for offline servers, that when fired will tell me each and every affected applications which relies on that server.
IF the custom property is in the Application table, then you should be able to pick it from the list of variables (Insert Variable) and it will be called ${App_group}.
If the custom property is in the nodes table, then your field will be a little more complicated. My "didn't try this first" guess is:
$SQL{select nodes.App_group from nodes where nodes.nodeid = ${NodeID} }
In both cases, you would put that code into the MESSAGE tab of the alert action.
Let me know if you get stuck or if I missed something there.
I believe it is in the Application table (I have attached a screenshot).
It doesn't appear in the list of variables, so I tried to manually enter it in but it still didn't appear.
I am trying to include it as informantion in my alert notification.