DX Unified Infrastructure Management

Expand all | Collapse all

Email Notification Message Body

  • 1.  Email Notification Message Body

    Posted Apr 13, 2017 03:51 PM

    I have an email notification and it contains the following section (obtained from the $message variable) within the email body:

     

    Average (5 samples) total cpu is now 31.45%, which is above the error threshold (30%).Top Processes [splunkd.exe[764]-(27.08%)];[java.exe[4176]-(0.58%)];[os_agent.exe[2264]-(0.50%)];[DsaServer.exe[1716]-(0.33%)];[java.exe[2012]-(0.25%)]

     

    I would like to format it as follows so that it is easier on the eyes to read and read quickly:

     

    Average (5 samples) total cpu is now 31.45%, which is above the error threshold (30%).

     

    Top Processes

    [splunkd.exe[764]-(27.08%)]

    [java.exe[4176]-(0.58%)]

    [os_agent.exe[2264]-(0.50%)]

    [DsaServer.exe[1716]-(0.33%)]

    [java.exe[2012]-(0.25%)]

     

    Can someone point me in the right direction to accomplish this?



  • 2.  Re: Email Notification Message Body

    Broadcom Employee
    Posted Apr 14, 2017 01:28 AM

    Then probably you might need to modify the existing HTML template which the emailgtw is using for formatting of email alarms or try creating a new template as per the requirement.



  • 3.  Re: Email Notification Message Body

    Posted Apr 14, 2017 12:36 PM

    The HTML template is fine. The problem is the highlighted section I want to format noted above is all contained in one variable $message.  I was hoping there were some controls behind the scenes I can edit for this variable.  I fear this is a coding issue that would require an update instead.  



  • 4.  Re: Email Notification Message Body

    Posted Apr 17, 2017 10:10 AM

    I think it is out of box ,because the alarm itself will display the process in that format,which is difficult to customize



  • 5.  Re: Email Notification Message Body

    Posted Apr 20, 2017 12:42 AM

    Hi cduryea,

     

    Need your little help.

    I am very much interested in the alert which you have configured to monitor CPU utilization and it shows the top 5 utilization process as well. Would really like to know how you have configured it. 

    I have a very critical requirement from client on this.

     

    Thanks

    Ankur



  • 6.  Re: Email Notification Message Body

    Posted Apr 20, 2017 01:31 AM

    It comes standard in the newest version of CDM I believe. 



  • 7.  Re: Email Notification Message Body

    Posted Apr 20, 2017 01:36 AM

    Ankur,

    I'm going on memory on this as I do not have UIM in front of me.

     

    In your cdm setup you will have an option to collect the Top processes. Enable this and set it to 3 or 5. I did this through MCS 'setup cdm' in UMP USM groups so I don't recall where this option is located in cdm through IM. I can look in the morning and update you more specifically.

     

    Then in IM, go to your primary hub, open the configuration of your cdm probe, click setup tab, click messages tab. You will see a box full of messages and their severity level and below that you will see several small tabs, the first one being CPU. On this CPU tab on the left you will see two rows. The tops says something. Like CriticalCPU and the bottom one I think says LowCPU. Each has a field next to them I believe with Custom... You want to click and drag the CPUErrorProcesses message from above and drop it on the field next to CriticalCPU, this will change its contents. You want to drag CPUWarningProcesses to the field next to Low CPU. Click Apply and Ok. Do note if you are using MCS to configure cdm, I do know from experience that you will need to redo this section in cdm of every device every time you make a configuration change in cdm to a device. There is a way to simplify this reapplying but I have not gotten to that yet though I do plan to soon as my device count is climbing quickly. As an administrator I don't like doing the same task over and over again so I plan to simplify.

     

    Sorry I cannot be more specific at the moment but this should get you started in the right direction of what to search for.



  • 8.  Re: Email Notification Message Body

    Posted Apr 20, 2017 01:53 AM

    You would have it set by default under Advance tab if you are installing a new version of cdm 

     

     

    In case you have upgraded from an older version to a new version you would need to manually update the message definitions for CPU usage by drag and droping the CpuErrorProcesses and CpuWarningProcesses 

     



  • 9.  Re: Email Notification Message Body

    Posted Apr 20, 2017 03:13 AM

    Thanks cduryea and Phani for quick support. In my case the cdm probe is on the latest version 5.80 and in message definitions, both CPUErrorProcesses and CPUWarningProcesses are not present. Snapshot FYR.

     



  • 10.  Re: Email Notification Message Body

    Posted Apr 20, 2017 03:24 AM

    You need to scroll down the message ID u can see the CPUErrorProcesses  and CPUWarningProcesses just drag and drop to cpu usage text box.

     

     It will work only for cpu alert ,nor memory



  • 11.  Re: Email Notification Message Body

    Posted Apr 20, 2017 05:10 AM

    Hello Everyone,

     

    Thanks to everyone for the help. I was able to see the message definitions. I have configured it and it stands resolved now.

    Would also like to know if the same can be implemented in memory case as well.

     

    Thanks

    Ankur



  • 12.  Re: Email Notification Message Body

    Posted Apr 20, 2017 03:44 PM

    Let me clarify, the cdm 5.80 probe is defaulted to the proper values to capture top processes.  The cdm 5.80-MC (deployed and used by MCS) is not defaulted and must be configured like I mentioned.  If you do not use MCS then you should be fine assuming you have 5.80 or higher.



  • 13.  Re: Email Notification Message Body

    Posted Apr 20, 2017 07:47 PM

    No, similar option is not available for Memory , there are few ideas already open for this. You can vote for one if you nee it 

     

    UIM cdm probe:Top Memory consuming process in alarm 



  • 14.  Re: Email Notification Message Body

    Posted Apr 20, 2017 08:40 AM

    You are welcome.



  • 15.  RE: Email Notification Message Body

    Posted Aug 18, 2020 03:09 AM
    Hi Christopher,

    ¿were you able to format the message variable? I want to do the same but i can't

    Thanks


  • 16.  RE: Email Notification Message Body

    Posted Aug 18, 2020 07:59 AM
    My guess is that you can format the cdm Message definition using HTML tags. Doing so will make the Email look good, but it will screw the alarms in the Alarm Dashboard.


  • 17.  RE: Email Notification Message Body

    Broadcom Employee
    Posted Aug 18, 2020 08:20 AM
    There is no out of the box formating for the Alarm message.
    The only way this would be possible would be to use a Lua script to break down the message and then recreate it with the returns and breaks that you want.
    This is not tested nor supported so I can not tell you what effect this might have on display in USM or Dashboards.
    It might also break something as UIM will not be expecting this in the alarm field and may not handle it well.

    ------------------------------
    Gene Howard
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 18.  RE: Email Notification Message Body

    Posted Aug 18, 2020 08:28 AM
    HI,

    What i want is to format the alarm message. I am using the NAS LUA pre-processing to add some aditional information in the message and an AO profile to send the email. 
    I am using HTML tags but don´t work. The email is as follow:

    This tags are on $message variable but the html template in emailgtw use it like string.




  • 19.  RE: Email Notification Message Body

    Broadcom Employee
    Posted Aug 18, 2020 08:48 AM

    That is what I would expect as the field is treated as a string field.
    The only thing I think might work would be adding in none printing characters to the field.

    So you would need to break up the alarm message into variables and add them back togeather with hard returns.
    such as $message = $var1.."\n"..$var2.."\n"..

    https://www.lua.org/pil/2.4.html

    Here is an example of how to parse a message
    https://community.broadcom.com/enterprisesoftware/viewdocument/tech-tip-uim-lua-script-to-split-a?CommunityKey=170eb4e5-a593-4af2-ad1d-f7655e31513b&tab=librarydocuments



    ------------------------------
    Gene Howard
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 20.  RE: Email Notification Message Body

    Posted Aug 19, 2020 06:48 AM
    Hi,

    Using  $message = $var1.."\n"..$var2.."\n".. doesn´t work. 

    If i put the string:

    PRUEBA <tr><td>Problema:699 -> URL: https://gac64053.live.dynatrace.com/#problems/problemdetails;pid=-2050460672328873699_1596800040000V2;gf=all </td></tr> <tr><td>Problema:692 -> URL: https://gac64053.live.dynatrace.com/#problems/problemdetails;pid=-8885770074766166692_1596716880000V2;gf=all </td></tr> <tr><td>Problema:126 -> URL: https://gac64053.live.dynatrace.com/#problems/problemdetails;pid=-4945342424548746126_1595314380000V2;gf=all </td></tr>


    In the $message variable the emailgtw replace the HTML tags and doesn´t work too, but if the string above i put it in the $custom_5(for example) and add this variable in the HTML template in emailgtw it WORKS!!!


    I have used the following script in a pre-procesing rule:

    ...
    event.custom_5 = "Text with HTML tags"
    return event

    In the HTML template in emailgtw:
    ...
    <tr>
    <td width="100%" bgcolor="#FFFFFF"><i>$message</i></td>
    </tr>
    <tr>
    <td width="100%" bgcolor="#FFFFFF"><i>$custom_5</i></td>
    </tr>
    ...


  • 21.  RE: Email Notification Message Body

    Posted Aug 19, 2020 10:11 AM
    You have quite a number of issue to overcome when tackling this and your first step is to understand the boundaries between products and where to look to fix something.

    When UIM sends an email it essentially takes the individual variables  ($message, $custom_5, etc) and substitutes them into the text or html template you have specified. It then puts that into the "message" section of a standard email.

    Your substitutions appear to be working - they might not have the data you need but they are operating. That means that really this isn't a UIM issue that you are tackling here - it's either a mail formatting issue or an issue with the way your email client decides to display the message content.

    I'd suggest having a look at the HTML source of the email message that's displayed in your email client and then ask yourself the question why, if it were just hand written HTML, why it's not rendering as you desire.

    And if you want/need to parse apart pieces of individual variables - like putting carriage returns in the message, you should just go the Lua route - ultimately you will have the most flexibility that way - likely too, in order to get the formatting to work you will need to introduce an HTML header into the message and to do that you'll need to go the Lua route anyway.


  • 22.  RE: Email Notification Message Body

    Posted Aug 20, 2020 09:33 AM
    Hi,

    I have invested a lot of time in this and I think I have found the best solution. As in everything, the simplest solution is the best for a "complex" problem.
    I have found the way to parse apart pieces of individual variables.
    I have put the HTML tag "<pre></pre>" in the HTML template in the emailgtw and a script like this $message = $var1.."\n"..$var2.."\n".. works.
    This is an example of what i have done:

    LUA script:
    event.message = "PRUEBA-NIMBUS OpenCCA"
    event.custom_5 = "Contexto Dynatrace: \n Problema:304 -> URL..."
    return event

    HTML template(emailgtw):
    </tr>
    <tr>
    <td width="100%" bgcolor="#FFFFFF"><i>$message</i></td>
    </tr>
    <tr>
    <td width="100%" bgcolor="#FFFFFF"><i><pre>$custom_5</pre></i></td>
    </tr>
    Mail:



    Thanks