Hi,
I want to execute a script + "send mail" for the triggering alarm, and I want to execute a script + "send mail" for the CLEAR of the alarm.
The reason for this is because I want to have different text/details in alarm and clear messages.
Is it possible?
The way "execute on clear" works now is that it also sends clear message when alarm is triggered + when the alarm is cleared. I want "execute on clear" to work only when clear happens.
I.e. on this picture:
If I choose "Execute on clear" on both script and mail, it will send clear message when alarm triggers + when alarm clears. But since I make a "custom" message both in the script (for sms) and mail, I want it ONLY triggered on clear - not "also".
Hi Havard,
I believe in this case a possible option will be sending the email notification in the script:
- In the correlation rule, create a single action 'Run Script'. You will need to select the option 'Execute on clear'
- In the script you could perform the following actions (using a C# script block):
- Read the severity of the alarm that triggered the correlation rule. You could use a snippet available in DataMiner Help (How do I parse Correlation Alarm Info Data?)
- When reading the severity, you can define a condition that depends of the severity of the alarm. If the alarm severity is 'Normal', this means that the alarm was cleared. You can send an email using the method SendMail (via script). If the alarm severity is different than 'Normal', this means that the alarm was raised. Similar as previous case, you could also send an email via script
Hope it helps.
Alternatively, once could also use the script input parameter to detect whether this is a newly triggered (“up”) or a cleared correlation action (“down”).
( https://docs.dataminer.services/user-guide/Advanced_Modules/Automation_module/Special_parameters_available_in_DMS_Automation_scripts.html )