Identify if OPC-UA server was rebooted

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
jramirez-jh
Hero Member
Hero Member
Posts: 21
Joined: 14 Jun 2021, 23:39

Identify if OPC-UA server was rebooted

Post by jramirez-jh »

Hello,

I'm looking for a way to identify from my Client if the target (connected) OPC-UA server was rebooted. I'm pretty new to the SDK so I'm unsure if this is something possible or not, because I understand it can be a very tricky scenario, for example if the reboot was not planned like when the physical machine where the server is running on was rebooted or a power outage occured.

In a more common scenario I think I can listen to the UnifiedAutomation.UaClient.Session.ConnectionStatusUpdate event, but I want to be sure if there is another way to try to identify this, for example, the OPC-UA Server SDK saves the last start-up time? or the time elapsed since the last successful start-up? That info (if available) could help to do a rough estimate about when happened the last reboot.

Regards

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Identify if OPC-UA server was rebooted

Post by Support Team »

Hi,

every OPC UA Server has a Node "StartTime" in it's address space. You could read out directly after being connected and check after reconnect. If StarTime is "unchanged", it was (oviously) just a network interuption that caused the reconnect, but if StarTime is different this would indicate that the server was shutdown and completely restarted. Furthermore the Node "ServerStatus" can give you information about the shutdown reason.
Best regards
Unified Automation Support Team

jramirez-jh
Hero Member
Hero Member
Posts: 21
Joined: 14 Jun 2021, 23:39

Re: Identify if OPC-UA server was rebooted

Post by jramirez-jh »

Support Team wrote:
15 Jun 2021, 09:04
Hi,

every OPC UA Server has a Node "StartTime" in it's address space. You could read out directly after being connected and check after reconnect. If StarTime is "unchanged", it was (oviously) just a network interuption that caused the reconnect, but if StarTime is different this would indicate that the server was shutdown and completely restarted. Furthermore the Node "ServerStatus" can give you information about the shutdown reason.
Thanks for your reply.

Regarding this info contained inside the StartTime node, I'm wondering if the data is somehow persisted by the Server SDK or if is it needed to implement a custom logic to do it by our own?

For instance, let's say the Windows/Linux machine where the OPC-UA Server is running on was rebooted, then after reboot the OPC-UA server will be autostarted (by a Windows Service or a Linux Daemon) Does the data will be preserved?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Identify if OPC-UA server was rebooted

Post by Support Team »

Hi,

no the server decides himself what data to persist, some servers may even create some "history" of certain data points and store them in a database, but again that is an individual implementation decision on the server side.

Typically, if the server shuts down (for whatever reason) and it will come back later and again initialize or restart his datasource, it will get fresch values from his subsystem and continue with providing live data. In a first place the UA Server is just an casulation (and interface) of some data source. However OPC UA (Historical Access) has the ability provide time series of stored data and events (see historizing attribute of a node).
Best regards
Unified Automation Support Team

Post Reply