Where to find server stale status in database


Product(s):APM Implementation and Performance Management
Version(s): N\A
Environment: N\A
Area: N/A
Subarea: N\A

Question:

Where can we find the status "stale", that is shown on the Server Manager page , in the database.
Is there a certain table and field that they can look up and determine server status?

Answer:

There's no direct flag in the database for this. The server manager considers a server stale if it hasn't called the server manager in 4x the reporting interval.

In the apm database, there is a table called oq.ServerHealth. It should be updated every time the server calls the server manager. In theory you could read that, for the appropriate SERVERID (of the form: <machinename>_server_Bentley_<instance> and use the LASTUPDATE_DTTM (Note *not* LASTUPDATED_DTTM) and RPTINTERVAL (which is in seconds) to determine if the server is stale. something like: if (now() - LASTUPDATE_DTTM) > (4 * RPTINTERVAL) )

The file BrokerServerList.xml in app_data (may be different in a MaS or Azure web app) is where the server manager stores it.

<ArrayOfBrokerFullServerInfo xmlns:xsd="">www.w3.org/.../XMLSchema" xmlns:xsi="">www.w3.org/.../XMLSchema-instance">
<BrokerFullServerInfo>
<Address>localhost</Address>
<Instance>default</Instance>
<Port>44314</Port>
<Health>0</Health>
<WebMonitorURL>localhost:44314/.../WebMonitorURL>
<RemoteServiceURL>localhost:44314/.../RemoteServiceURL>
<MobileServiceURL>localhost:44314/.../MobileServiceURL>
<ClientCommunicationMode>https</ClientCommunicationMode>
<ServerId>NAOU99999_server_Bentley_default</ServerId>
<StartingUp>false</StartingUp>
<Shutdown>false</Shutdown>
<Locked>false</Locked>
<Language>en-US</Language>
<AcceptsClientConnections>true</AcceptsClientConnections>
<AcceptsRemoteSynchronizationConnections>false</AcceptsRemoteSynchronizationConnections>
<AcceptsHandheldSynchronizationConnections>true</AcceptsHandheldSynchronizationConnections>
<ReportingInterval>10</ReportingInterval>
<Authenticated>true</Authenticated>
<LastUpdate>2020-03-05T19:15:49.3372667Z</LastUpdate>
<UpSince>2020-03-05T18:55:40.8049028Z</UpSince>
<ServerIsDisconnected>false</ServerIsDisconnected>
<ServerShouldStartDisconnected>false</ServerShouldStartDisconnected>
<LicenseStatus>Ok</LicenseStatus>
<SessionID>Naou99999-ivaraserver-4696-a95f75f2-fdb0-4aba-be4b-399ec5df55d2</SessionID>
<ProcessIsBeingMonitored>false</ProcessIsBeingMonitored>
</BrokerFullServerInfo>
</ArrayOfBrokerFullServerInfo>

LastUpdate and ReportingInterval would be the nodes of interest.

A server is considered stale if: ( ( current time in utc - <LastUpdate> ) in seconds ) is greater than ( 4 * <ReportingInterval> )