denisbrodbeck / machineid

Get the unique machine id of any host (without admin privileges)
MIT License
985 stars 139 forks source link

FreeNAS (FreeBSD variant) doesn't display any content with smbios.system.uuid property #1

Closed xor-gate closed 6 years ago

xor-gate commented 6 years ago

I tried your commands on a FreeBSD -> FreeNAS variant system and the machineid is empty. Probably we should check if empty for a file at /etc/hostid. See below:

root@shulgin:~ # kenv -q smbios.system.uuid
root@shulgin:~ # /etc/rc.d/hostid start
Setting hostuuid: e1e7d8e1-8432-11e7-b267-0cc47a40cb81
root@shulgin:~ # cat /etc/hostid
e1e7d8e1-8432-11e7-b267-0cc47a40cb81
denisbrodbeck commented 6 years ago

Hey @xor-gate, you're right. Fired up a fresh FreeNAS 11 VM and verified the issue.

Changed doc and code to:

  1. read /etc/hostid
  2. call kenv -q smbios.system.uuid, if previous step fails

Thanks for reporting this issue :+1:

xor-gate commented 6 years ago

Great! If you are interested I have some of your work derived and added to my package. But this uses a different approach (sysdetect interface, eg local or SSH). See https://github.com/xor-gate/sysdetect/blob/master/machineid.go.

Your work is very much appreciated!