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

Have syscollector collect/obtain the device serial number #5699

Closed
fernandogont opened this issue Jul 18, 2023 · 4 comments
Closed

Have syscollector collect/obtain the device serial number #5699

fernandogont opened this issue Jul 18, 2023 · 4 comments
Assignees
Labels
level/task Task issue reporter/community Issue reported by the community type/enhancement Enhancement issue

Comments

@fernandogont
Copy link

Description

One of the most important identifiers in a workstation or system is its serial number. However, it seems syscollerctor fails to collect it.

In Linux, you can get this information via:
sudo dmidecode -t system

In MacOS, you can collect this information via:
system_profiler SPHardwareDataType

Tasks

The steps that have to be completed in order to close the issue.

  • [Collect serial number in Linux systems]
  • [Collect serial number for Window systems ]
  • [Collect the serial number for MacOS systems]

Additional information

As noted before, this is how you can collect the aforementioned information:

In Linux, you can get this information via:
sudo dmidecode -t system

In MacOS, you can collect this information via:
system_profiler SPHardwareDataType

@Dwordcito
Copy link
Member

Dwordcito commented Jul 19, 2023

Hi @fernandogont

It's nice to receive this comment from you!

This data is currently being collected by syscollector, moreover, this data is the primary key of the hardware info table.

What happens here is that this data is not being shown, therefore it is correct where I created the issue!

Linux implementation
https://github.com/wazuh/wazuh/blob/ffa66c34698cb12b52161b022f69e3f5f02a1229/src/data_provider/src/sysInfoLinux.cpp#L138
MacOS implementation
https://github.com/wazuh/wazuh/blob/ffa66c34698cb12b52161b022f69e3f5f02a1229/src/data_provider/src/hardware/hardwareWrapperImplMac.h#L36
Windows implementation
https://github.com/wazuh/wazuh/blob/ffa66c34698cb12b52161b022f69e3f5f02a1229/src/data_provider/src/sysInfoWin.cpp#L436

Here you can see how to obtain this information from the API
https://documentation.wazuh.com/current/user-manual/api/reference.html#operation/api.controllers.syscollector_controller.get_hardware_info

@AlexRuiz7 AlexRuiz7 added the reporter/community Issue reported by the community label Aug 3, 2023
@gdiazlo gdiazlo added type/enhancement Enhancement issue level/task Task issue type/bug Bug issue and removed type/enhancement Enhancement issue labels Aug 3, 2023
@gdiazlo gdiazlo added type/enhancement Enhancement issue and removed type/bug Bug issue labels Aug 21, 2023
@JuanGarriuz JuanGarriuz self-assigned this May 14, 2024
@JuanGarriuz JuanGarriuz removed their assignment Jun 3, 2024
@JuanGarriuz JuanGarriuz self-assigned this Jan 29, 2025
@JuanGarriuz
Copy link
Contributor

Hello @fernandogont

Hi, this capability has already been implemented since version 4.7.2. You can check it in this issue:

@fernandogont
Copy link
Author

Note: the device serial number is different than the board serial number.

IOW, in the most majority of cases I've seen, the two are the same. But this need not be the case. The "device serial number" is the serial number you'll usually find e.g. in a sticker at the back of the laptop. But for some vendors, this number may differ from the board serial number.

@divyanshuc3ii
Copy link

Note: the device serial number is different than the board serial number.

IOW, in the most majority of cases I've seen, the two are the same. But this need not be the case. The "device serial number" is the serial number you'll usually find e.g. in a sticker at the back of the laptop. But for some vendors, this number may differ from the board serial number.

Yes it differs for many vendors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue reporter/community Issue reported by the community type/enhancement Enhancement issue
Projects
None yet
Development

No branches or pull requests

6 participants