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
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • 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
    • Tutorials
    • 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
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • 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
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Dynamically Retrieving Elements in DataMiner using Alarm Information filtered by correlation rule

Solved883 views19th July 2023automation scipt correlation engine Correlation rule
2
A B M Sidddique [DevOps Advocate]371 29th June 2023 0 Comments

Hello DataMiner Community,

I'm working on a project where I need to dynamically retrieve elements based on alarm information in DataMiner. Currently, I'm using the following code to extract the alarm information,The parts array contains the necessary properties such as dmaID and elementID.(How do I parse Correlation Alarm Info data? | DataMiner Docs):

Now, I want to use these dmaID and elementID or anyother properties to dynamically retrieve the associated elements using the available methods in the DataMiner Automation API and then try to set a certain parameter of the element. I noticed there are methods like FindElement and FindElementByKey in the DataMiner Automation API documentation, but I'm not sure how to properly use them in my scenario, a method to retrieve the element ID - so I can initialize my target variable to the value I retrieve.

.Could you please guide me on how to utilize these methods or any other relevant methods to retrieve elements dynamically based on the  any properties from the alarm information? the element id extracted is of the alarm generated but element key of the component is different. Currently my script works when I provide static values of the element key in the Findelement method

Any help or example code snippets would be greatly appreciated!

Thank you in advance.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 19th July 2023

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
4
Amer Hodzic [DevOps Member]774 Posted 29th June 2023 6 Comments

Assuming you have set the correlation rule correctly and it gets triggered by an alarm then I would do this:

int elementID = Tools.ToInt32(parts[2]); // Gets the Element ID

int dmaID = Tools.ToInt32(parts[1]); // Gets the Dma ID

Element myElement = engine.FindElement(dmaID,elementID);

myElement.SetParameter();

that should be what your looking for.

*** Edit ***

Correlation rule set

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 19th July 2023
A B M Sidddique [DevOps Advocate] commented 29th June 2023

Hi Amer ,

Yes I have set the correlation rule correctly with the special key aswell,which prints out the alarm properties.

I have tried this logic , the dmaID and the elementID that is found by the correlation rule is of the alarm and I would like to use any of the alarm properties to find the associated element key (DMAID/ElementID) of the element in the driver affected by the alarm and then set parameter of a component of that element. My correlation rule would work on multiple elements (if active) so need the use dynamic values of dmaID and elementID

Amer Hodzic [DevOps Member] commented 29th June 2023

Hi,

I have justed tested it multiple time with different elements and different DMAs and it runs perfectly fine no matter which element triggers it

Amer Hodzic [DevOps Member] commented 29th June 2023

namespace test_1
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages.SLDataGateway;

///
/// Represents a DataMiner Automation script.
///
public class Script
{
///
/// The script entry point.
///
/// Link with SLAutomation process.
public void Run(IEngine engine)
{
ScriptParam paramCorrelationAlarmInfo = engine.GetScriptParam(65006);
string alarmInfo = paramCorrelationAlarmInfo.Value;
string[] parts = alarmInfo.Split(‘|’);
int elementID = Int32.Parse(parts[2]); // Gets the Element ID

int dmaID = Int32.Parse(parts[1]); // Gets the Dma ID

Element myElement = engine.FindElement(dmaID, elementID);

myElement.SetParameter(7,0);
}
}
}

Amer Hodzic [DevOps Member] commented 29th June 2023

check the update for the correltaion rule in the answer.
One thing that can be causing the issue is if some dlls are missing.

A B M Sidddique [DevOps Advocate] commented 29th June 2023

Appreciate your detailed help Amer ,Will keep on testing with these edits.

current update : the script and correlation rule works for one element and breaks and prints exception message for another. Somethings I edited from run(Engine engine) to run(Iengine engine).Also added the last dataminer package as your sample.

Show 1 more comments
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

Recent questions

How to implement bearer token refresh? 0 Answers | 0 Votes
Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
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

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin