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

Parameter in protocol is not refreshed

52 views9 hours ago#editdriver dataminer driver driver driver info signings protocol
1
Jose Araujo [DevOps Member]72 17 hours ago 2 Comments

I'm developing a driver that gets information from a REST API. I'm retrieving the ping status from the endpoint into the protocol.

The issue appears when this value changes (API Status) — the parameter does not refresh. To force an update, I need to restart the element on the DMA and show current status.

Get 200  status in Wireshark, Qaction detect this but don't refresh parameter

Qaction 101

using Skyline.DataMiner.Scripting;

using System;

using System.Net;

using System.Text.RegularExpressions;

public class TimeoutWebClient : WebClient

{

public int Timeout { get; set; }

public TimeoutWebClient(int timeout)

{

Timeout = timeout;

}

protected override WebRequest GetWebRequest(Uri address)

{

var request = base.GetWebRequest(address);

if (request != null)

{

request.Timeout = Timeout;

if (request is HttpWebRequest httpRequest)

{

httpRequest.ReadWriteTimeout = Timeout;

}

}

return request;

}

}

public class QAction

{

public void Run(Skyline.DataMiner.Scripting.SLProtocol protocol)

{

try

{

string ip = protocol.GetParameter(15) as string;

protocol.Log("IP : " + ip, LogType.Information);

if (string.IsNullOrEmpty(ip) || !ip.Contains("."))

{

protocol.SetParameter(10, "Fail");

protocol.Log("Invalid IP Address", LogType.Error);

return;

}

string url = $"http://{ip}/api/v1/system/network/ping";

var client = new TimeoutWebClient(180000);

client.Headers[HttpRequestHeader.ContentType] = "application/json";

string response = client.DownloadString(url);

protocol.Log("Raw response: " + response, LogType.Information);

var match = Regex.Match(response, "\"ping\"\\s*:\\s*\"([a-zA-Z]+)\"");

if (match.Success)

{

string pingValue = match.Groups[1].Value.ToLower();

protocol.Log("Ping Value: " + pingValue, LogType.Information);

if (pingValue == "ok")

{

protocol.SetParameter(10, "Normal");

}

else

{

protocol.SetParameter(10, "Fail");

}

}

else

{

protocol.SetParameter(10, "Fail");

protocol.Log("No match found in ping response", LogType.Information);

}

}

catch (WebException ex)

{

protocol.SetParameter(10, "Fail");

protocol.Log("Ping WebException: " + ex.Message, LogType.Error);

}

catch (Exception ex)

{

protocol.SetParameter(10, "Fail");

protocol.Log("Ping Exception: " + ex.Message, LogType.Error);

}

}

}

Protocol

<Paramid="10"trending="false"save="true">

<Name>ServerStatus</Name>

<Description>API Status</Description>

<Type>read</Type>

<Information>

<Includes>

<Include>time</Include>

<Include>range</Include>

<Include>steps</Include>

<Include>units</Include>

</Includes>

</Information>

<Interprete>

<RawType>other</RawType>

<Type>string</Type>

<LengthType>next param</LengthType>

</Interprete>

<Alarm>

<Monitored>true</Monitored>

<Normal>Normal</Normal>

<CH>Fail</CH>

</Alarm>

<Display>

<RTDisplay>true</RTDisplay>

<Positions>

<Position>

<Page>General</Page>

<Row>0</Row>

<Column>0</Column>

</Position>

</Positions>

</Display>

<Measurement>

<Type>string</Type>

</Measurement>

</Param>

</QAction>

<QActionid="101"name="PingCheck"encoding="csharp"triggers="10">

</QAction>

</QActions>

<Groups>

<Groupid="10">

<Name>Update Parameters basic</Name>

<Description>Updte info of Titan Live</Description>

<Type>poll</Type>

<Content>

<Param>11</Param>

<Param>12</Param>

<Param>14</Param>

<Param>15</Param>

</Content>

</Group>

<Groupid="20">

<Name>Update Parameters advance</Name>

<Description>Updte info of Titan Live</Description>

<Type>poll</Type>

<Content>

<Param>1101</Param>

<Param>1102</Param>

<Param>1103</Param>

<Param>1104</Param>

<Param>13</Param>

</Content>

</Group>

<Groupid="30">

<Name>Health Startup Group</Name>

<Type>poll action</Type>

<Description>Health API Module</Description>

<Content>

<Action>2</Action>

</Content>

</Group>

<Groupid="40">

<Name>Healthcheck module</Name>

<Type>poll action</Type>

<Description>Health API Module</Description>

<Content>

<Action>2</Action>

</Content>

</Group>

</Groups>

<Triggers>

<Triggerid="1">

<Name>Health trigger</Name>

<Time>after startup</Time>

<On>protocol</On>

<Type>action</Type>

<Content>

<Id>1</Id>

</Content>

</Trigger>

</Triggers>

<Actions>

<Actionid="1">

<Name>After Startup Health Trigger</Name>

<Onid="30">group</On>

<Type>execute</Type>

</Action>

<Actionid="2">

<Name>Call Health Trigger</Name>

<Onid="10">parameter</On>

<Type>run actions</Type>

</Action>

<Actionid="3">

<Name>Login Button Action</Name>

<Onid="300">parameter</On>

<Type>run actions</Type>

</Action>

<Actionid="4">

<Name>Healthcheck Module</Name>

<Onid="10">parameter</On>

<Type>increment</Type>

</Action>

</Actions>

<Timers>

<Timerid="1">

<Name>health check Module</Name>

<Timeinitial="true">160000</Time>

<Interval>180</Interval>

<Content>

<Group>10</Group>

</Content>

</Timer>

</Timers>

Jose Araujo [DevOps Member] Posted new comment 9 hours ago
José Silva [SLC] [DevOps Catalyst] commented 15 hours ago

Hi Jose,

I noticed you're trying to share some images, but unfortunately, I'm not able to see them on my end. Could you please try uploading them again?

Thanks
Kind regards,

Jose Araujo [DevOps Member] commented 9 hours ago

Hi Jose,

was update with images.

Thanks
Jose

0 Answers

  • Active
  • Voted
  • Newest
  • Oldest
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