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 detect an agent is stopping / stopped via automation?

Solved632 views4th June 2024Automation startup
0
Mieke Dryepondt [SLC] [DevOps Advocate]3.60K 17th January 2024 0 Comments

I have several user defined APIs set up that need to interact with elements across the system. When one of the agent is stopping (e.g. initiating an upgrade) another agent can still be processing the API > running the automation script > trying to do a set on an element on the agent that is stopping.

In those cases I encounter an exception on the param set even when the logic will first:

  1. verify the element exists via engine.FindElement
  2. verify the element is active via element.IsActive

most likely this is because at that point in time, the agent was busy stopping.

Is there a way to know that this has been initiated? This would allow the API to return the proper response and not crash.

Mieke Dryepondt [SLC] [DevOps Advocate] Selected answer as best 4th June 2024

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
Jan Staelens [SLC] [DevOps Advocate]889 Posted 17th January 2024 0 Comments

Though that particular use case has never been verified and tested. You could try to use the following method Method IsStartupComplete | DataMiner Docs, part of the Skyline.DataMiner.Core.DataMinerSystem namespace (available through a NuGet package).

It’s a bit more clever in its checking, in that it handles if data is fully loaded or not.

The IDms classes will also do more validation on sets, making sure the element exists before most calls.

If you want to check the state of an agent specifically:

You can ask the the agent state: Verify if agent is running

IDms dms = engine.GetDms();
IDma agent = dms.GetAgent(346);

AgentState state = agent.State;

Mieke Dryepondt [SLC] [DevOps Advocate] Selected answer as best 4th June 2024
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