Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show in agent table the disconnection reason #5680

Merged
merged 15 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to the Wazuh app project will be documented in this file.
### Added

- Support for Wazuh 4.7.0
- Added `status detail` column in the agents table. [#5680](https://github.com/wazuh/wazuh-kibana-app/pull/5680)

### Changed

Expand Down
3 changes: 2 additions & 1 deletion docker/imposter/agents/agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"node_name": "master",
"group": ["default", "debian"],
"lastKeepAlive": "2022-09-12T08:48:40Z",
"version": "Wazuh v4.3.7"
"version": "Wazuh v4.3.7",
"status_code": 0
}
],
"total_affected_items": 1,
Expand Down
3 changes: 2 additions & 1 deletion docker/imposter/agents/agent_active_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"test8"
],
"lastKeepAlive": "2022-09-12T08:48:40Z",
"version": "Wazuh v4.5.0"
"version": "Wazuh v4.5.0",
"status_code": 0
}
],
"total_affected_items": 1,
Expand Down
3 changes: 2 additions & 1 deletion docker/imposter/agents/agent_disconnected.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"ip": "111.111.1.111",
"mergedSum": "e669d89eba52f6897060fc65a45300ac",
"configSum": "97fccbb67e250b7c80aadc8d0dc59abe",
"group_config_status": "synced"
"group_config_status": "synced",
"status_code": 2
}
],
"total_affected_items": 1,
Expand Down
3 changes: 2 additions & 1 deletion docker/imposter/agents/agent_macos.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"node_name": "master",
"lastKeepAlive": "9999-12-31T23:59:59Z",
"version": "Wazuh v4.5.0",
"group_config_status": "synced"
"group_config_status": "synced",
"status_code": 3
}
],
"total_affected_items": 1,
Expand Down
3 changes: 2 additions & 1 deletion docker/imposter/agents/agent_never_connected.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"node_name": "unknown",
"registerIP": "any",
"id": "004",
"ip": "any"
"ip": "any",
"status_code": 4
}
],
"total_affected_items": 1,
Expand Down
3 changes: 2 additions & 1 deletion docker/imposter/agents/agent_pending.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"status": "pending",
"mergedSum": "x",
"node_name": "master-node",
"manager": "wazuh_manager_filebeat_sources_cmake-v4.4.0-rc1-7.10.2"
"manager": "wazuh_manager_filebeat_sources_cmake-v4.4.0-rc1-7.10.2",
"status_code": 5
}
],
"total_affected_items": 1,
Expand Down
30 changes: 20 additions & 10 deletions docker/imposter/agents/agents.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"node_name": "master",
"lastKeepAlive": "9999-12-31T23:59:59Z",
"version": "Wazuh v4.4.0",
"group_config_status": "synced"
"group_config_status": "synced",
"status_code": 0
},
{
"os": {
Expand All @@ -55,7 +56,8 @@
"node_name": "master",
"lastKeepAlive": "9999-12-31T23:59:59Z",
"version": "Wazuh v4.4.0",
"group_config_status": "not synced"
"group_config_status": "not synced",
"status_code": 0
},
{
"os": {
Expand All @@ -76,8 +78,9 @@
"manager": "wazuh-manager-master-0",
"node_name": "master",
"lastKeepAlive": "9999-12-31T23:59:59Z",
"version": "Wazuh v4.4.0",
"group_config_status": "synced"
"version": "Wazuh v4.5.0",
"group_config_status": "synced",
"status_code": 0
},
{
"os": {
Expand All @@ -103,7 +106,8 @@
"ip": "111.111.1.111",
"mergedSum": "e669d89eba52f6897060fc65a45300ac",
"configSum": "97fccbb67e250b7c80aadc8d0dc59abe",
"group_config_status": "not synced"
"group_config_status": "not synced",
"status_code": 1
},
{
"status": "never_connected",
Expand All @@ -113,7 +117,8 @@
"registerIP": "any",
"id": "004",
"ip": "any",
"group_config_status": "not synced"
"group_config_status": "not synced",
"status_code": 4
},
{
"os": {
Expand All @@ -135,7 +140,8 @@
"node_name": "master",
"lastKeepAlive": "9999-12-31T23:59:59Z",
"version": "Wazuh v4.5.0",
"group_config_status": "synced"
"group_config_status": "synced",
"status_code": 2
},
{
"os": {
Expand All @@ -145,6 +151,7 @@
"version": "18.04.6 LTS"
},
"group_config_status": "not synced",
"status_code": 0,
"ip": "172.19.0.27",
"status": "pending",
"name": "Pending agent",
Expand All @@ -163,7 +170,8 @@
"registerIP": "any",
"id": "007",
"ip": "any",
"group_config_status": "not synced"
"group_config_status": "not synced",
"status_code": 5
},
{
"status": "never_connected",
Expand All @@ -173,7 +181,8 @@
"registerIP": "any",
"id": "008",
"ip": "any",
"group_config_status": "not synced"
"group_config_status": "not synced",
"status_code": 1
},
{
"status": "never_connected",
Expand All @@ -183,7 +192,8 @@
"registerIP": "any",
"id": "009",
"ip": "any",
"group_config_status": "not synced"
"group_config_status": "not synced",
"status_code": 2
},
{
"os": {
Expand Down
29 changes: 29 additions & 0 deletions plugins/main/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,35 @@ export const AGENT_SYNCED_STATUS = {
NOT_SYNCED: 'not synced',
}

// The status code can be seen here https://github.com/wazuh/wazuh/blob/686068a1f05d806b2e3b3d633a765320ae7ae114/src/wazuh_db/wdb.h#L55-L61

export const AGENT_STATUS_CODE = [
{
STATUS_CODE: 0,
STATUS_DESCRIPTION: 'Agent is connected',
},
{
STATUS_CODE: 1,
STATUS_DESCRIPTION: 'Invalid agent version',
},
{
STATUS_CODE: 2,
STATUS_DESCRIPTION: 'Error retrieving version',
},
{
STATUS_CODE: 3,
STATUS_DESCRIPTION: 'Shutdown message received',
},
{
STATUS_CODE: 4,
STATUS_DESCRIPTION: 'Disconnected because no keepalive received',
},
{
STATUS_CODE: 5,
STATUS_DESCRIPTION: 'Connection reset by manager',
},
];

// Documentation
export const DOCUMENTATION_WEB_BASE_URL = "https://documentation.wazuh.com";

Expand Down
Loading