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

How to update IP settings on multiple nodes via automation

Solved1.38K views29th September 2022Automation element ip settings
1
Jan-Terje Larsen96 26th September 2022 0 Comments

Hi,

I've been searching the dojo for hints on how to update IP settings via automation, and this article came close: https://community.dataminer.services/question/change-elements-ip-address-from-automation-script/

Aparantly the "currentElementInfo.PortInfo[0].PollingIPPort" does not contain the IP anymore, it only has the port.

Can someone provide an updated example, or any other ideas on how to approach this?

I'm also looking for a way to enable/disable the SNMP agent (under Advanced element settings) for each device via automation.

We are running version 10.2.0.0-11774-CU3

BR
Jan-Terje Larsen

Paulo Henriques [SLC] [DevOps Member] Answered question 29th September 2022

4 Answers

  • Active
  • Voted
  • Newest
  • Oldest
3
Paulo Henriques [SLC] [DevOps Member]550 Posted 26th September 2022 1 Comment

Hi Jan-Terje,

Below I'm sharing with you an automation script I've created some time ago to change the SNMPv3 credentials for a specific set of elements. Now, I have added also the IP address so you can use it a reference and starting point to reach your goal. Please test it carefully.

Note this is just an idea as I'm note sure if there is a more straightforward way to do it.

Hope it helps.

using System;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages;

public class Script
{
//------------------------------------------------------------------------------------------------------------------------------------
// these are the input parameters of the script, please make sure they are correct:
//------------------------------------------------------------------------------------------------------------------------------------
const string sUserName = "admin"; // snmpv3 user name
const string sGetComPwd = "password_AAA"; // snmpv3 authentication password
const string sSetComPwd = "password_BBB"; // usually both authentication and encryption passwords are the same
const string sIpAddress = "127.0.0.1"; // Polling IP address

const int iIntervalBetweenChanges = 500; // in miliseconds

String[] elements = { "CMTS#1", "CMTS#2" }; // Names of the elements to be changed
//------------------------------------------------------------------------------------------------------------------------------------

public void Run(Engine engine)
{
engine.GenerateInformation("Change Element Passwords | Starting!");

engine.Timeout = TimeSpan.FromMinutes(60);

int nrElements = 0;
int nrElementsChanged = 0;

foreach (String sElement in elements)
{
nrElements++;

if (ChangeElementCredentials(engine, sElement))
nrElementsChanged++;
engine.Sleep(iIntervalBetweenChanges);
}

engine.GenerateInformation("Total of " + nrElementsChanged + " out of " + nrElements + " elements changed.");
engine.GenerateInformation("Change Element Passwords | Completed!");

}

public bool ChangeElementCredentials(Engine engine, String elementName)
{

try
{
Element eEl = engine.FindElement(elementName);

GetLiteElementInfo glei = new GetLiteElementInfo();
glei.DataMinerID = eEl.DmaId;
glei.ElementID = eEl.ElementId;

LiteElementInfoEvent leie = Engine.SLNet.SendSingleResponseMessage(glei) as LiteElementInfoEvent;

ElementPortInfo[] PortInfo = leie.PortInfo;

bool bChanged = false;
foreach (ElementPortInfo epi in PortInfo)
{
if (epi.ProtocolType.ToString().Equals("SnmpV3"))
{
epi.PollingIPAddress = sIpAddress;
epi.DataBits = sUserName;
epi.GetCommunity = sGetComPwd;
epi.SetCommunity = sSetComPwd;
bChanged = true;
}
}

if (bChanged)
{
engine.GenerateInformation("--> changing " + eEl.ElementName);
AddElementMessage aem = new AddElementMessage();
aem.DataMinerID = eEl.DmaId;
aem.ElementID = eEl.ElementId;
aem.ProtocolName = leie.Protocol;
aem.ProtocolVersion = leie.ProtocolVersion;
aem.Ports = PortInfo;

engine.GenerateInformation("--> changing " + eEl.ElementName + "; Sending AddElement message");
Engine.SLNet.SendSingleResponseMessage(aem);
}

}
catch (Exception ex)
{
engine.GenerateInformation("--> ERR: changing " + elementName + " failed!. Skipping this element. " + ex.ToString());
return false;
}

return true;
}

}

Ben Vandenberghe [SLC] [DevOps Enabler] Selected answer as best 26th September 2022
Jan-Terje Larsen commented 26th September 2022

Thanks Paolo, the asnwers the IP address question.
Do you know where/how I can also set the SNMP Agent check-box ?

BR
Jan-Terje

You are viewing 1 out of 4 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

Recent questions

Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 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