Skip to main content

1E 23.7 (SaaS)

Agent.GetConnectionInformation

Method

GetConnectionInformation

Module

Agent

Library

Core

Action

Returns Switch connection and Background Channel information.

Parameters

(None)

Return values

Slot (int): The Switch slot number on the given Switch worker hosting the Agent connection.

SwitchConnectionTime (string): The UTC date and time that the Agent connected to the Switch. See notes.

SwitchId (int): The database identifier of the Switch instance to which the Agent is connected.

SwitchName (string): The name of the Switch instance to which the Agent is connected. (Not the hostname of the Switch.)

Worker (int): The Switch worker number hosting the Agent connection.

BGCCertThumbprint (string): Thumbprint of the certificate received from the Background Channel.

BGCConnected (string): Indicates whether the last Background Channel connection succeeded.

BGCConnectionTime (string). The UTC date and time that the Agent last attempted a Background Channel connection.

ClientCertThumbprint (string): Thumbprint of the certificate sent to the Switch.

LocalIpAddress (string): Local IP address that the Agent is using to connect to the Switch.

LocalPort (string): Local port that the Agent is using to connect to the Switch.

RemoteIpAddress (string): Remote IP address of the Switch.

RemotePort (string): Remote port of the Switch.

SwitchCertThumbprint (string) Thumbprint of the certificate received from the Switch.

SwitchClockSkewSeconds (int): The number of seconds ahead (negative if behind) of UTC time that this Agent is relative to the Switch based on most recent timestamp exchange (see notes).

Example

 Agent.GetConnectionInformation();

Platforms

  • Windows

  • Linux

  • MacOS

Notes

If the Nomad module is enabled then the Agent will not access the Background Channel directly and cannot report on that connection.

The device's clock skew relative to the Switch is determined each time it connects to the Switch, and when an acknowledged keep-alive packet is transferred (typically in the order of hours/days). You can therefore use the SwitchConnectionTime field returned by this method to determine an upper-bound to the age of this information. If the 1E Client has not yet connected to the Switch since it started, or is connected to an older version of the Switch which does not support timestamp negotiation, SwitchClockSkewSeconds will be NULL.

Note

Return values are always strings. If you need to perform comparison or mathematical operations on numbers then you need to CAST the string.