Last Visible or Last Successful Heartbeat

Comments

4 comments

  • Colby Bouma

    I don't know why it's not available as a column on the main page, but you can create a SQL Report with LastIsOnlineTime.

    SELECT
    Name
    , LastIsOnlineTime
    FROM
    Computers
    WHERE
    <ComputerFilter>
    0
    Comment actions Permalink
  • Jean Davis

    Thank you. When does that timestamp register exactly?

    I have a few servers saying "2021-07-21 06:06:30" which are up and running and PDQ sees them.

    1
    Comment actions Permalink
  • Colby Bouma

    I was wrong about what LastIsOnlineTime represents. I did some experimentation and figured out that it's the last time the target went from offline to online.

    • LastIsOnlineTime - The last time IsOnline changed from 0 to 1
    • LastIsOfflineTime - The last time IsOnline changed from 1 to 0
    • HeartbeatDate - The last time a Heartbeat was sent to the target

    If IsOnline = 1, then HeartbeatDate is the last successful Heartbeat. If IsOnline = 0, then LastIsOfflineTime is when the target went offline. Here's a SQL Report that pulls that logic into 1 field. Technically, when IsOnline = 0, this report is off by whatever your Heartbeat Interval is since it will show the Heartbeat after the last successful one, but hopefully it's close enough. You can remove the extra fields if you don't want them.

    SELECT
    Name
    , IsOnline
    , LastIsOnlineTime
    , LastIsOfflineTime
    , HeartbeatDate
    , CASE
    WHEN IsOnline = 0 THEN
    LastIsOfflineTime
    ELSE
    HeartbeatDate
    END 'Last Heartbeat'
    FROM
    Computers
    WHERE
    <ComputerFilter>
    2
    Comment actions Permalink
  • Jean Davis

    Fantastic! Thanks Colby. This helps alot.

    1
    Comment actions Permalink

Please sign in to leave a comment.