Hardware Discovery Agent is part of the Edge Manageability Framework. It is used to discover Edge Node host hardware features and report them to the Edge Infrastructure Manager service. It uses following data sources:
udevadmcommand: monitoring on hardware changes, only monitor onblockandnetsubsystem.dmidecodecommand: to extract system serial number./procdirectory: read/proc/cpuinfofor CPU information./sysdirectory: read/sys/devices/system/memory,/sys/class/net,/sys/blockfor memory, Network Interface Card, and disk information.lsmemcommand: retrieves information related to the memory available on the Edge Node.lsblkcommand: provides disk information for the Edge Node.lscpucommand: extracts information about the CPUs installed on the Edge Node.lsusbcommand: collects information on the USB devices connected.lshwcommand: collects information on the GPU devices connected to the Edge Node.lscpicommand: collects information on the PCI addresses of GPU devices on the Edge Node.ipcommand: provides information on the IP addresses associated with the different Network interfaces on the Edge Node.ipmitoolcommand: BMC interface information.unamecommand: provides information on the kernel version installed on the Edge Node.lsb_releasecommand: provides information on the OS installed on the Edge Node.
If any tool is missing Hardware Discovery Agent will still generate the output and send it to the Edge Infrastructure Manager, but those fields populated by the missing tools will be left empty.
To develop Hardware Discovery Agent, the following prerequisites are required:
The required Go version for the agents is outlined here.
Run the make hdabuild command to build the hardware discovery agent binary. The compiled binary can be found in the build/artifacts directory.
Example:
$ cd hardware-discovery-agent/
$ make hdabuild
$ ls build/artifacts/
hd-agentRun the make package command to build the hardware discovery agent Debian package. The package can be found in the build/artifacts directory.
Example
$ cd hardware-discovery-agent/
$ make package
$ ls build/artifacts/
hardware-discovery-agent_<VERSION>_amd64.build hardware-discovery-agent_<VERSION>_amd64.changes package
hardware-discovery-agent_<VERSION>_amd64.buildinfo hardware-discovery-agent_<VERSION>_amd64.debRun the make tarball command to generate a tarball of the hardware discovery agent code. The tarball can be found in the build/artifacts directory.
Example
$ cd hardware-discovery-agent/
$ make tarball
$ ls build/artifacts/
hardware-discovery-agent-<VERSION> hardware-discovery-agent-<VERSION>.tar.gzTo run the hardware discovery agent binary after compiling:
./build/artifacts/hd-agent -config config/hd-agent.yaml
The hardware discovery agent Debian package can be installed using apt:
sudo apt install -y ./build/artifacts/hardware-discovery-agent_<VERSION>_amd64.debTo uninstall the hardware discovery agent, use apt:
sudo apt-get purge -y hardware-discovery-agent-
Status
sudo systemctl status hardware-discovery-agent -
Start
sudo systemctl start hardware-discovery-agent -
Stop
sudo systemctl stop hardware-discovery-agent
To view logs:
sudo journalctl -u hardware-discovery-agent
-
Build hardware discovery agent binary and mock binaries:
make build -
Run unit tests:
make test -
Run integration tests:
make integration_test -
Run linters:
make lint -
Get code coverage from unit and intergration tests:
make cover -
Run package test:
make package_test
Apache-2.0