This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Add 'Monitored Service' variable to e-mail alert

Hello everyone.  I currently have an application template that includes both performance monitor metrics and windows service monitor components.  In a scenario where one of the windows services goes down I would like to receive an e-mail alert letting me know which node has the problem, and which particular monitored service has been reported as down.  A scenario like this one can be seen as follows:

Node.jpg

Application.jpg

Component.jpg

If I want to send an e-mail alert to include the specific service name (in this example it is 'Adapt Servicee'), what variable would I need to use?  I have attempted to write an alert on both component and application types, but cannot locate the variable for the monitored service name in either.  This is what I have so far:

At ${N=Alerting;M=AlertTriggerTime;F=DateTime} ${N=SwisEntity;M=Application.Node.DisplayName} reported ${N=SwisEntity;M=Application.ApplicationAlert.ApplicationName} to be down.

Thanks in advance,
MSJ

  • Most people rename the components from the default to something descriptive, like the service name in this case.

  • As Marc mentioned, it is much more helpful to add a descriptive name to each component.

    Here is an example I have from an application monitor I created for one of our web clusters that monitors the central health pages.

    kschmalz_0-1592341669539.png

    I then have my alert definition configured with the following script in the message body:

    <b>Application Component Status(es):</b>
    ${SQL:SELECT cast(cast([ComponentName]as varchar(max)) + '' + ' ' as XML), cast(cast([StatusOrErrorDescription]as varchar(max)) + '' + CHAR(10) + CHAR(13) as XML) FROM [APM_AlertsAndReportsData] where ApplicationId = ${N=SwisEntity;M=ApplicationID} FOR XML PATH('')}

    Now when one of our web servers is dropped from the cluster the email alert I receive contains the following information:

    Application Component Status(es):
    Server 1 Component is up. HTTP 200. Request succeeded.

    Server 2  Component is up. HTTP 200. Request succeeded.

    Server 3  Requested file was not found. HTTP 404. Resource not found. The remote server returned an error: (404) Not Found.

    Server 4  Component is up. HTTP 200. Request succeeded.

    Not sure if this is the best method but it has been working really well for us for years now for almost all of our application monitors. I can usually identify the problem component that triggered the alert right away.