Email integration and how to include alarm details in the alarm message being emailed.
search cancel

Email integration and how to include alarm details in the alarm message being emailed.

book

Article ID: 141224

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

I am sending alarms to SNOW through email and want to include all alarm details being displayed in Nimsoft to be sent in the mail. Please let me know the message variables to include in the mail template.

Environment

  • Release: 9.0.2 or higher
  • Component: UNIFIED INFRASTRUCTURE MGMT

Cause

  • Guidance

Resolution

Profiles can override the default message template and email subject. Email messages are formatted by the emailgtw probe. The emailgtw probe's DEFAULT is set to send emails using an HTML format. If desired, HTML format can be DISABLED by changing a flag in the emailgtw configuration. This flag is not exposed by the configuration GUI, but can be accessed using Raw Configuration: (just do this for the specific emailgtw profile, e.g., admin, Operator, LinuxOperators, Joe, etc) if so desired. 

1. Highlight emailgtw probe. 
2. Select Raw Configure... 
3. Select the "use_html" key in the "setup" folder 
4. Press the "Edit" button, change the value to "no", and press "OK" if you want to use plain text. 
5. Press the "OK" button to apply the change and close the Raw Configure Tool. 
6. Deactivate emailgtw probe. 
7. Activate emailgtw probe. 

***Note that you can use either an html or .txt email template but NOT both. 

Other options: You can change the Subject or message body on an overall level or per specific emailgtw PROFILE.

IMPORTANT:
If you enter a $ sign in the Subject field and wait a moment, you will get a drop-down of message variable fields you can use. This will include message, subsystem, count, etc. 

Tips: To get a "category" of the alarm, the subsystem is probably your best bet. It should be the $subsys variable. This would mean making sure the subsystem IDs set by the alarms are useful, but most of the probes set fairly useful subsystem IDs by default. You may need to tweak some to fit into categories that are most useful to you though. You can Edit the emailgtw template file as you see fit, e.g., add origin, etc, and call it whatever you like, for instance <user1>.txt or template1.html if you're not using a plain text template. 

WARNING: template.txt is the original email template text file so don't overwrite that one. 

[Alarm message] 
Level: $level_exp ($level) 
Subsystem: $subsys 
Message: $message 
NimID: $nimid 
Sent: $nimts_exp ($nimts) 
Source: $source 
Domain: $domain 
Robot: $robot 
ProbeID: $prid 
Hostname: $hostname 
SubsystemID: $sid 
Event: $supp_key 
Arrival: $arrival_exp ($arrival) 
Suppressed: $supptime_exp ($supptime) 
Count: $suppcount 
Exported by: $exported_by 
Export type: $exported_type
Profile: $profile

etc

etc

For instance, to add origin, a common request from customers, add one line to the template: 

Origin: $origin and then when finished, place this file into: .../Program Files (x86)/Nimsoft/probes/gateway/emailgtw/ and reference it in the profile for that specific user using the Raw Configure option for the emailgtw probe. 

For example, Under Setup->Profile Key and Value would be: template <user1>.txt

e.g., adding origin below...

You can click the button in the emailgtw probe to edit the template.html and add variables to the alarm message to be emailed.

.....
<tr>
 <td width="25%"><b><font color="#FFFFFF">$source[$hostname_strip]</font></b></td>
 <td width="25%"><b><font color="#FFFFFF">$subsys</font></b></td>
 <td width="25%"><b><font color="#FFFFFF">Robot: $robot</font></b></td>
 <td width="25%"><b><font color="#FFFFFF">Probe: $prid</font></b></td>
 <td width="25%"><b><font color="#FFFFFF">Origin: $origin</font></b></td>
</tr>
...

 

Additional Information

As an alternative, instead of using the HTML template, you can use a plain text template.

You can add quite a number of message variables that will affect all alarms. Most of them are listed below, but there are a few more.

When you have your cursor in the Subject window of the alarm gateway enter a $ and you will see the valid message variables.

Edit the template.txt in the emailgtw directory, e.g., ...\Program Files (x86)\Nimsoft\probes\gateway\emailgtw

[Alarm message]
  Level:        $level_exp ($level)
  PreviousLevel:$prevlevel
  Subsystem:    $subsys
  Message:      $message
  Count  $count
  NimID:        $nimid
  Sent:  $nimts_exp ($nimts) 
  Source:       $source
  Domain:       $domain
  Hub:  $hub
  Robot:        $robot
  ProbeID:      $prid
  Hostname:     $hostname
  SubsystemID:  $sid
  Event:        $supp_key
  AOTimeStamp: $aots
  Arrival:      $arrival_exp ($arrival)
  Suppressed:   $supptime_exp ($supptime)
  Count:        $suppcount
  Origin: $origin
  TimeZone: $supptime_tzexp
  AssignedAt: $assigned_at
  AssignedTo: $assigned_to
  AO_Argument $ao_argument
  UserTag1: $user_tag1
  UserTag2: $user_tag2

Then reference the template.txt in the emailgtw via the GUI->Setup icon->General-Template.

Then deselect the 'Use HTML format' checkbox.

Click Ok and the emailgtw will restart.

To test the alarm results, you can setup a nas AO rule to ensure you get an email when you generate an alarm.

You can send a test alarm with the string you're filtering on, via nas->Status Tab->Rt-click in the window and 'Send Test alarm' using a string that will trigger your alarm.

Here is an example of the plain text alarm when received via email.

Nimsoft Message: Alarm from <host>

<email_address>
6:45 PM (0 minutes ago)
to me

[UIM Alarm message]
  Level:        critical (5)
  PreviousLevel:5
  Subsystem:    Process
  Message:      wininit.exe: Process wininit.exe is running with process id = 444.
  Count         11
  NimID:        MB51723322-26640
  Sent:         12/05/19 15:35:35 (1575588935)
  Source:       ##.##.###.###
  Domain:       <uim_domain>
  Hub:          <uim_hub>
  Robot:        <uim_robot>
  ProbeID:      processes
  Hostname:     <hostname>
  SubsystemID:  1.1.2
  Event:        process/wininit.exe/process_state
  AOTimeStamp:  1575589538
  Arrival:      12/05/19 15:35:41 (1575588941)
  Suppressed:   12/05/19 15:45:35 (1575589535)
  Count:        10
  Origin:       <origin>
  TimeZone:     12/05/19 15:45:35
  AssignedAt:   1575589120
  AssignedTo:   <userid>
  AO_Argument   <email_address>
  UserTag1:     xx|yyy|zzz
  UserTag2:     MyRobot|Test1|Test2