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
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How to get Service alarm level in c# automation?

Solved2.11K views10th July 2023Automation
2
Cyrus Uible [SLC]40 17th August 2020 0 Comments

Dojo Community, I’m trying to figure how to get the service alarm level inside of a C# script.  Something like.

Service testService = engine.FindServiceByKey(“123/123”);

if ( testService alarm level == critical)

{

// do something

}

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

3 Answers

  • Active
  • Voted
  • Newest
  • Oldest
5
Tim Vandenbruwaene [SLC] [DevOps Enabler]2.18K Posted 18th August 2020 0 Comments

Hi Cyrus,

There’s an SLNET call called GetServiceStateMessage that you can use which will allow you to get the alarm state of the service.

Note that this is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 10th July 2023
1
Miguel Obregon [SLC] [DevOps Catalyst]19.15K Posted 17th August 2020 0 Comments

Hi Cyrus,

In these cases, normally we trigger the Automation script from a Correlation rule.

  • In the Correlation rule, you can configure a filter based on the service name and alarm severity.
  • In the action, you can point to the Automation script that you want to execute.

Please keep in mind that you can pass information from the Correlation rule to the Automation script. For more information, refer to How do I parse Correlation Alarm Info data? in the DataMiner Help.

Marieke Goethals [SLC] [DevOps Catalyst] Changed status to publish 18th August 2020
0
Ruben Vandepitte [SLC] [DevOps Advocate]2.32K Posted 18th August 2020 0 Comments

In addition to the already proposed solutions, there is also the possibility to work with an enhanced service. In case you assign a service protocol to the service, you can expose a parameter which holds the service state.

With our standard “Skyline Service Definition Basic” protocol, the service state will be exposed in parameter with id 2.

Through an automation script, it is then possible to fetch the parameter value.

—

ElementFilter filter = new ElementFilter { IncludeServiceElements=true, NameFilter=”serviceName” };

Element[] els = engine.FindElements(filter);

double severityLevel = Convert.ToDouble(els[0].GetParameter(2));

—

The advantage of this approach over the proposed alternatives:

  • Not using SLNet calls, which are not documented and not guaranteed to be backwards compatible.
  • Not having to use correlation and having to rely on individual alarms in order to draw conclusions on the overall service state, which could quickly get quite complex.

The downside is that an enhanced service consumes some system resources. Especially if you’re working on a large scale – a lot of service objects – you’ll need to carefully consider if this is the right approach.

Ruben Vandepitte [SLC] [DevOps Advocate] Answered question 18th August 2020
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