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
    • 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
    • DataMiner Insights
      • Security
      • System Architecture
      • DataMiner Releases & Updates
    • 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

Services are created outside the view that i have mentioned – automation script DM

Solved488 views9th September 2024#automationscript Automation DIS Automation script Skyline.DataMiner.Automation SLAutomation
1
Baranisudha Murugesan784 21st August 2024 0 Comments

In dataminer i'm creating services for monitoring using automation scripts under a common view in DM called Monitoring. Below is the code i use to create the service. Im facing issue like, if i create services in bulk, 3 out of 8 services are created outside of my view.

private object CreateService(string serviceName, List<ServiceInfoParams> serviceParams, string viewNewName)
{
_engine.GenerateInformation("Create service starts here");
var service = new ServiceInfoEventMessage { Name = serviceName };
service.ServiceParams = serviceParams.ToArray();
var addServiceMessage = new AddServiceMessage
{
Service = service,
var viewIDs = new[] { GetViewForServiceCreation(viewNewName).Id };
};
_engine.GenerateInformation("Create service ends here");
return engine.AddService(service, viewIDs);
}

private object AddService(AddServiceMessage addService)
{
try
{
_engine.GenerateInformation("Add service starts here"+addService.ViewIDs);
var dmsMessage = _engine.SendSLNetMessage(addService);
var response = (AddServiceResponseMessage)dmsMessage[0];
var dmaInfo = GetLocalDataMinerInfo();
_engine.GenerateInformation("Add service ends here");
return $"{dmaInfo.ID}/{response.NewID}";
}
catch (Exception e)
{
throw new InvalidDataException($"Failed to create service:{addService.Service.Name}. {e.Message}");
}
}

private IDmsView GetViewForServiceCreation(string viewName)
{
IDmsView view;
var getdms = (_engine as Engine).GetDms();
try
{
_engine.GenerateInformation("Get view starts here");
view = getdms.GetView(viewName);
}
catch (ViewNotFoundException)
{
view = getdms.GetView(-1);
}

_engine.GenerateInformation("Get view ends here");
return view;
}

private GetDataMinerInfoResponseMessage GetLocalDataMinerInfo()
{
try
{
_engine.GenerateInformation("Get DM info starts here");
GetInfoMessage message = new GetInfoMessage(InfoType.LocalDataMinerInfo);
_engine.GenerateInformation("Get DM info ends here");
return (_engine.SendSLNetSingleResponseMessage(message) as GetDataMinerInfoResponseMessage) ??
throw new DataMinerException("Failed to get Local DataMiner info");
}
catch (Exception innerException)
{
throw new DataMinerException("Failed to get Local DataMiner info", innerException);
}
}

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 9th September 2024

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Ive Herreman [SLC] [DevOps Enabler]13.55K Posted 9th September 2024 0 Comments

Hi Baranisudha,

The code below is ok.
After a deeper investigation, it was discovered that the problem was caused by a synchronization issue, which resulted from the time on the server being out of sync.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 9th September 2024
You are viewing 1 out of 1 answers, click here to view all answers.
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

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