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

Utility environment lookup, attributes #66

Merged
merged 8 commits into from
Nov 29, 2022
Merged

Utility environment lookup, attributes #66

merged 8 commits into from
Nov 29, 2022

Conversation

joelrebel
Copy link
Member

@joelrebel joelrebel commented Nov 25, 2022

What does this PR do

  • Defines environment variables for all utilities which can be exported by users to override utility path.
  • Updates all utilities to export attributes - name, absolute path and validation on the executable.
  • Exports the CheckDependencies() method which can be used by a caller to validate utilities.

Screenshot 2022-11-25 at 16 07 22

…gurors, collectors, updaters.

This interface defines a method to retrieve the utility attributes
like the name, absolute path and an error if it was not found on the
host system.
This allows consumers of the library to define env vars
for all utilities supported by ironlib.
…ble()

These methods return the utility command absolute path and checks if the
bin is available and executable.
The Attributes() method returns the utility name, absolute path and
check if the executable is available for execution.
It prints output in the form

```
  util: dmidecode, path: /sbin/dmidecode [ok]
  util: asrr-bioscontrol, path: /usr/sbin/asrr-bioscontrol [ok]
  util: dell-racadm, path: /opt/dell/srvadmin/bin/idracadm7 [err] - lstat /opt/dell/srvadmin/bin/idracadm7: no such file or directory: failed to run lstat on bin
  util: dnf, path: /usr/bin/microdnf [ok]
  util: dsu, path: dsu [err] - exec: "dsu": executable file not found in $PATH: failed to lookup bin path
  util: hdparm, path: /usr/sbin/hdparm [ok]
  util: lshw, path: /usr/sbin/lshw [ok]
  util: lsblk, path: /usr/bin/lsblk [ok]
  util: mlxup, path: /usr/sbin/mlxup [ok]
  util: msecli, path: /usr/bin/msecli [ok]
  util: mvcli, path: mvcli [err] - exec: "mvcli": executable file not found in $PATH: failed to lookup bin path
  util: nvme, path: /usr/sbin/nvme [ok]
  util: smartctl, path: /usr/sbin/smartctl [ok]
  util: smc-ipmicfg, path: /usr/sbin/smc-ipmicfg [ok]
  util: smc-sum, path: /usr/sbin/sum [ok]
  util: storecli, path: /opt/MegaRAID/storcli/storcli64 [ok]
```
@joelrebel
Copy link
Member Author

pushed commit that updates all deps and Go to 1.19.

README.md Outdated Show resolved Hide resolved
@joelrebel joelrebel requested a review from splaspood November 29, 2022 08:49
@joelrebel joelrebel merged commit 1c92739 into main Nov 29, 2022
@joelrebel joelrebel deleted the env-lookup branch November 29, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants