Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Method of Clearing Alarms from the alarm console using an Automation script

Solved813 views27th January 2025alarm monitoring Automation script Automation script solution
2
A B M Sidddique [DevOps Advocate]371 16th September 2024 0 Comments

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 ?

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 27th January 2025

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
2
Joachim Ally [SLC] [DevOps Enabler]1.57K Posted 16th September 2024 9 Comments

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

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 27th January 2025
A B M Sidddique [DevOps Advocate] commented 16th September 2024

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 ?

Joachim Ally [SLC] [DevOps Enabler] commented 17th September 2024

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

A B M Sidddique [DevOps Advocate] commented 24th September 2024

Thank you very much Joachim , I am downloading the ZIP and pushing it to our test environment with VS pro- DIS . I used the SLNet client tool to get more alarm information , and thought of adding an extra bit of logic to clear only minor and warning alarms older than a week.

Joachim Ally [SLC] [DevOps Enabler] commented 24th September 2024

You’re welcome. That was indeed the goal of my explanation: that you could understand it yourself, use the shared automation script as a solid foundation, and then fine-tune it to your preferences. 🙂

A B M Sidddique [DevOps Advocate] commented 25th September 2024

Sorry for bothering again with a minor issue , I’m encountering an issue with the SetAlarmStateMessage constructor in a DataMiner Automation script.

“SetAlarmStateMessage setAlarmStateMessage = new SetAlarmStateMessage(alarm.TreeID, Skyline.DataMiner.Net.Enums.AlarmUserStatus.Clear, clearingMessage);”

I get this error : “There is no argument given that corresponds to the required formal parameter ‘value’ of SetAlarmStateMessage.SetAlarmStateMessage(int, int, int, string).”

From my SLNetclient test , i observed we don’t have ‘treeID’ comming in from the alarms , so instead i changed the treeID to take elementID and rootalarmID instead , as it required 4 args.

so now it tries to run this :
// Prepare to clear the alarm using SetAlarmStateMessage
SetAlarmStateMessage setAlarmStateMessage = new SetAlarmStateMessage(alarm.ElementID,
alarm.RootAlarmID,
(int)Skyline.DataMiner.Net.Enums.AlarmUserStatus.Clear,
clearingMessage);

The script executes successfully on the pop up , then in the automation logs and the informational events i can see an exception thrown , its usually a Port connection issue ,
port 751 or 440 (
Something went wrong: No connection with 751.

Server stack trace:

at Skyline.DataMiner.Net.RemoteAccess.Forward(MessageTarget target, DMSMessage[] messages)

at Skyline.DataMiner.Net.RemoteAccess.ForwardImpersonated(IConnectionInfo connInfo, Int32 dataMinerID, TargetedClientRequestMessage message)

at Skyline.DataMiner.Net.Facade.HandleClientRequestMessage(IConnectionInfo connInfo, ClientRequestMessage oneMsg, Boolean canQueue)

at Skyline.DataMiner.Net.Facade.HandleMessageInternal(IConnectionInfo connInfo, DMSMessage oneMsg, Int32 groupID, Int32 groupTotal)

at Skyline.DataMiner.Net.Facade.HandleMessage(IConnectionInfo connInfo, DMSMessage oneMsg, Int32 groupID, Int32 groupTotal)

at Skyline.DataMiner.Net.BaseFacade.HandleMessages(IConnectionInfo connInfo, DMSMessage[] msgs)

at Skyline.DataMiner.Net.Facade.HandleImpersonateMessage(IConnectionInfo originalConnInfo, ImpersonateMessage im)

at Skyline.DataMiner.Net.Facade.HandleMessageInternal(IConnectionInfo connInfo, DMSMessage oneMsg, Int32 groupID, Int32 groupTotal)

at Skyline.DataMiner.Net.Facade.HandleMessage(IConnectionInfo connInfo, DMSMessage oneMsg, Int32 groupID, Int32 groupTotal)

at Skyline.DataMiner.Net.BaseFacade.HandleMessages(IConnectionInfo connInfo, DMSMessage[] msgs)

at Skyline.DataMiner.Net.Facade.HandleMessagesForClient(IConnectionInfo connInfo, DMSMessage[] messages)

at Skyline.DataMiner.Net.Transport.Remoting.InternalHandleMessages(ConnectionToken token, DMSMessage[] inputMessages, ConnectionTransportType ctt)

at Skyline.DataMiner.Net.Transport.Remoting.HandleMessages(ConnectionToken token, DMSMessage[] inputMessages, ConnectionTransportType ctt)

at Skyline.DataMiner.Net.Transport.Remoting.HandleMessages(ConnectionToken token, DMSMessage[] inputMessages)

at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:

at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

at Skyline.DataMiner.Net.ISLNet.HandleMessages(ConnectionToken token, DMSMessage[] inputMessages)

at Skyline.DataMiner.Net.LegacyRemotingConnection.TransportSpecificHandleMessage(ConnectionToken tok, DMSMessage[] msgs, Int32 timeout)

at Skyline.DataMiner.Net.Connection.InternalHandlePackedMessages(ConnectionToken tok, DMSMessage[] msgs, Int32 timeout)

at Skyline.DataMiner.Net.Connection.InternalHandleUnpackedMessages(DMSMessage[] msgs, Int32 timeout)

at Skyline.DataMiner.Net.Connection.HandleMessages(DMSMessage[] msgs, Int32 timeout)

at Skyline.DataMiner.Net.PersistentConnectionContainer.SendMessages(DMSMessage[] messages)

at Skyline.DataMiner.Automation.Engine.SendSLNetMessages(DMSMessage[] messages)

at Skyline.DataMiner.Automation.Engine.SendSLNetMessage(DMSMessage message)

at ClearNoticeAlarmsOlderThanAWeek_1.Script.RunSafe(IEngine engine) (Script ‘Clear Notice Alarms Older Than A Week’)

Show 4 more comments
0
A B M Sidddique [DevOps Advocate]371 Posted 25th September 2024 2 Comments

These are the alarm properties and the highlighted ones are what I’m wanting to use.

A B M Sidddique [DevOps Advocate] Posted new comment 3rd October 2024
Joachim Ally [SLC] [DevOps Enabler] commented 3rd October 2024

Hi ABM,

To be honest, I did not really have a good response that I could think of. In the meantime, I saw you did a further follow-up on this question with a new Dojo-question. I really understand this approach and I see that my friendly colleague Tom is helping you further. Just for future reference, I am going to copy-paste the link here: so that if someone else from the community comes across this question, that person can easily get the extra explanation of Tom as well.

https://community.dataminer.services/question/issue-with-automation-script-constructor-argument-error-in-dm-version-10-3-0-0-13184/

I wish you the best of luck and hope you can finally get it working on your DataMiner. 🙂

Kind regards,
Joachim

A B M Sidddique [DevOps Advocate] commented 3rd October 2024

No worries , Thank you very much for your help on it !

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs