Hello Dojo Community !
I have an use case to build an automation script that would take the input of a period (by date) and then check the system for any warning or minor alarms raised in the system and clear them an automated way. Currently we do this buy right clicking on the alarm and click on the 'clear alarm' option . The Minor and warning alarms we are deleting are ones created internally by the correlation engine so we are not losing important traps just doing some house keeping.
I was investigating and found this : Code example - Take alarm ownership - DataMiner Dojo , and wanted to know if a method for clearing alarms existed (which I couldn't see in the documents site) , if so could you please guide me to it ?
Hi,
I made a small code snippet and published it on our Skyline Communications Github. You can view it from this link and also copy it over to your Automation module in DataMiner if you want: SkylineCommunications/SLC-AS-ClearNoticeAlarmsOlderThanAWeek: Example Automation Script that clears all notice alarms that are older than a week. (github.com) .
The code is getting all Active Alarms and filtering on rootCreationTime (clearing the ones older than one week ago) and severity. But I am not sure if you're restrictive enough, and I think it's wise to be careful to not clear more alarms than intended.
Therfore, before trying this out, I would maybe start by trying out the GetActiveAlarmsMessage with the SLNetClientTestTool and based on the response, you can check which alarms that are returned and on which fields you can filter them.
In below, I added inline two screenshots from a test that I did on an internal test system to visualize how you can do that.
Another option is for example the "DisplayValue", in this snippet that would be "if alarm.DisplayValue.Contains("...")" for example.
Hopefully this gets you further and if there are questions, please comment and we try to guide you further to the solution you want. 😊
Kind regards,
Joachim
Hi A B M,
I updated my answer, and I think this will help clarifying. The ClientTestTool is just there to test, the actual work is done in the Automation Script that I now included in the repo. You do not need to add or include other libraries than the ones that DataMiner already has available. The only thing is that you need the “usings” of “Skyline.DataMiner.Automation” and “Skyline.DataMiner.Net.Messages” . If you copy over the script from this file, you’re all set. https://github.com/SkylineCommunications/SLC-AS-ClearNoticeAlarmsOlderThanAWeek/blob/master/ClearNoticeAlarmsOlderThanAWeek_1/ClearNoticeAlarmsOlderThanAWeek_1.cs
Kind regards,
Joachim
Thank you for the Code Snippet, will try it out as you suggested by seeing the outputs of the alarm information retrieved ! I was not aware that we could use SLNet message client tool to run automation scripts. Will look into it . Wouldn’t it require to have the correct libraries for the methods in SLNet client tool ?