| bin | ||
| cmd | ||
| internal | ||
| migrations | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| CHANGELOG.md | ||
| config.env | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| README.md | ||
Magellan
Magellan is a small tool designed to scan a network and collect BMC information
to load the data into an hms-smd instance.
How It Works
Magellan is designed to do three things:
- Scan for BMC nodes in cluster available on a network
- Query information about each BMC node
- Store queried information into a database
Magellan first tries to probe for specified hosts using the dora
API. If that fails, it then tries to use its own built-in, simpler scanner as a fallback.
Next, it tries to query information about the BMC node using bmclib functions, but requires
access to a redfish interface on the node to work. Once the BMC information is received,
it is then stored into hms-smd using its API.
In summary, magellan needs at minimum the following configured to work on each node:
- Available redfish interface with its host and port
- A running instance of
hms-smdwith its host and port - Additional dependencies for
bmclibsuch asipmitool
Building
Install Go, clone the repo, and then run the following in the project root:
git clone https://github.com/bikeshack/magellan
cd magellan
go mod tidy && go build
This should find and download all of the required dependencies. Although other versions of Go may work, the project has only been tested with v1.20.
Usage
There are three main commands to use with the tool: scan, list, and collect.
To scan a network for BMC nodes, use the scan command. If the port is not specified,
magellan will probe ports 623, 442 (redfish and IPMI) by default:
./magellan scan --subnet 192.168.0.0 --db.path data/assets.db --port 623
This will scan the 192.168.0.0 subnet returning the host and port that return a response
and store the results in database with path data/assets.db. Additional flags can
be set such as host to add more hosts to scan not included on the subnet, timeout to set how long
to wait for a response from the BMC node, or threads to set the number of requests
to make concurrently. Try using ./magellan help scan for a complete set of options.
To see the available BMC nodes found from the scan, use the list command. Make
sure to point to the same database used before:
./magellan list --db.path data/assets.db
This will print a list of IP address and ports found and stored from the scan.
Finally, run the collect command to store BMC info into hms-smd:
./magellan collect --db.path data/assets.db --driver ipmi --timeout 5 --user admin --pass password
This uses the info store in the database above to request information about each
BMC node if possible. It uses the driver specified by the driver flag which is
passed to and set in bmclib. Like with the scan, the time to wait for a response
can be set with the timeout flag as well. This command also requires the user
and pass/password flag to be set to use ipmitool (which must installed as well).
Additionally, it may be necessary to set the host and port flags for magellan
to find the hms-smd API.
Note: If the db.path flag is not set, magellan will use /tmp/magellan.db by default.
TODO
List of things left to fix, do, or ideas...
- Switch to internal scanner if
dorafails - Set default port automatically depending on the driver used to scan
- Test using different
bmclibsupported drivers (mainly 'redfish') - Confirm loading different components into
hms-smd - Add unit tests for
scan,list, andcollectcommands - Clean up, remove unused, and tidy code