Skip to content

Commit

Permalink
Add hostname board serial fields to agent inventory (#6191)
Browse files Browse the repository at this point in the history
* Add hostname and board_serial to agent inventory

* Remove Camelcase from Board Serial

* test snap fixed

* Fix format

* Added snaps and changelod

* Edit hostname to host name in dashboard and changelog
  • Loading branch information
JuanGarriuz authored Dec 11, 2023
1 parent 38a58b9 commit 3cc0cd4
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 4 deletions.
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.2
- Added host name and board serial information to Agents > Inventory data [#6191](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6191)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
</div>
</div>
<div
class="euiFlexItem"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium"
Expand All @@ -78,6 +78,30 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
/>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium"
>
Host name:
<span
class="euiLoadingSpinner euiLoadingSpinner--small"
/>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiText euiText--medium"
>
Board serial:
<span
class="euiLoadingSpinner euiLoadingSpinner--small"
/>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
Expand Down Expand Up @@ -2096,7 +2120,7 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
</div>
</div>
<div
class="euiFlexItem"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium"
Expand All @@ -2107,6 +2131,30 @@ exports[`Inventory component A Linux agent should be well rendered. 1`] = `
/>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium"
>
Host name:
<span
class="euiLoadingSpinner euiLoadingSpinner--small"
/>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiText euiText--medium"
>
Board serial:
<span
class="euiLoadingSpinner euiLoadingSpinner--small"
/>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
Expand Down Expand Up @@ -4199,7 +4247,7 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
</div>
</div>
<div
class="euiFlexItem"
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium"
Expand All @@ -4210,6 +4258,30 @@ exports[`Inventory component A Windows agent should be well rendered. 1`] = `
/>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<div
class="euiText euiText--medium"
>
Host name:
<span
class="euiLoadingSpinner euiLoadingSpinner--small"
/>
</div>
</div>
<div
class="euiFlexItem"
>
<div
class="euiText euiText--medium"
>
Board serial:
<span
class="euiLoadingSpinner euiLoadingSpinner--small"
/>
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function InventoryMetrics({ agent }) {
)}
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={true}>
<EuiFlexItem grow={false}>
<EuiText>
CPU:{' '}
{syscollector.isLoading ? (
Expand All @@ -105,6 +105,30 @@ export function InventoryMetrics({ agent }) {
)}
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText>
Host name:{' '}
{syscollector.isLoading ? (
<EuiLoadingSpinner size='s' />
) : syscollector.data.os.hostname ? (
<strong>{syscollector.data.os.hostname}</strong>
) : (
<strong>-</strong>
)}
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={true}>
<EuiText>
Board serial:{' '}
{syscollector.isLoading ? (
<EuiLoadingSpinner size='s' />
) : syscollector.data.hardware.board_serial ? (
<strong>{syscollector.data.hardware.board_serial}</strong>
) : (
<strong>-</strong>
)}
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText>
Last scan:{' '}
Expand Down

0 comments on commit 3cc0cd4

Please sign in to comment.