diff --git a/x-pack/plugins/fleet/common/types/models/agent.ts b/x-pack/plugins/fleet/common/types/models/agent.ts index 5def12287b4fd..fa54f8c943e27 100644 --- a/x-pack/plugins/fleet/common/types/models/agent.ts +++ b/x-pack/plugins/fleet/common/types/models/agent.ts @@ -84,6 +84,7 @@ interface AgentBase { policy_revision?: number | null; last_checkin?: string; last_checkin_status?: 'error' | 'online' | 'degraded' | 'updating'; + last_checkin_message?: string; user_provided_metadata: AgentMetadata; local_metadata: AgentMetadata; tags?: string[]; @@ -229,6 +230,10 @@ export interface FleetServerAgent { * Last checkin status */ last_checkin_status?: 'error' | 'online' | 'degraded' | 'updating'; + /** + * Last checkin message + */ + last_checkin_message?: string; /** * ID of the API key the Elastic Agent uses to authenticate with elasticsearch */ diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx index 5799b130b6a46..11ddcef4c8aee 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_details_page/components/agent_details/agent_details_overview.tsx @@ -58,6 +58,12 @@ export const AgentDetailsOverviewSection: React.FunctionComponent<{ '-' ), }, + { + title: i18n.translate('xpack.fleet.agentDetails.lastCheckinMessageLabel', { + defaultMessage: 'Last checkin message', + }), + description: agent.last_checkin_message ? agent.last_checkin_message : '-', + }, { title: i18n.translate('xpack.fleet.agentDetails.hostIdLabel', { defaultMessage: 'Agent ID', diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx index b2c03ba745d7b..93091ff726258 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_health.tsx @@ -74,8 +74,33 @@ export const AgentHealth: React.FunctionComponent = ({ agent, showOfflinePreviousStatus, }) => { - const { last_checkin: lastCheckIn } = agent; + const { last_checkin: lastCheckIn, last_checkin_message: lastCheckInMessage } = agent; const msLastCheckIn = new Date(lastCheckIn || 0).getTime(); + const lastCheckInMessageText = lastCheckInMessage ? ( + + ) : null; + const lastCheckinText = msLastCheckIn ? ( + <> + , + }} + /> + + ) : ( + + ); const previousToOfflineStatus = useMemo(() => { if (!showOfflinePreviousStatus || agent.status !== 'offline') { @@ -89,22 +114,10 @@ export const AgentHealth: React.FunctionComponent = ({ - , - }} - /> - - ) : ( - - ) + <> +

{lastCheckinText}

+

{lastCheckInMessageText}

+ } > <>