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

Can't get MAC address in macOS Monterey, netFillInfo not implemented on darwin #370

Open
sonvirgo opened this issue Jul 9, 2024 · 2 comments

Comments

@sonvirgo
Copy link

sonvirgo commented Jul 9, 2024

Can't get MAC address in macOS Monterey.
Also Disks not return any Serial number.

Error getting network info: netFillInfo not implemented on darwin

Screen Shot 2024-07-09 at 7 44 42 AM

@jaypipes
Copy link
Owner

jaypipes commented Jul 9, 2024

Hi @sonvirgo thank you for the issue. As noted in the README, we only have partial support for MacOS, unfortunately. We do not support network discovery for MacOS currently.

As for the Disk missing serial number information, can you please run the following and let us know what you get?

package main

import (
	"fmt"

	"github.com/jaypipes/ghw"
)

func main() {
	block, err := ghw.Block()
	if err != nil {
		fmt.Printf("Error getting block storage info: %v", err)
	}

	fmt.Printf("%v\n", block)

	for _, disk := range block.Disks {
		fmt.Printf(" %v\n", disk)
		if disk.SerialNumber != "" {
			fmt.Print("No serial number")
		} else {
			fmt.Printf("Serial number: %s\n", disk.SerialNumber)
		}
		for _, part := range disk.Partitions {
			fmt.Printf("  %v\n", part)
		}
	}
}

@sonvirgo
Copy link
Author

Hi @sonvirgo thank you for the issue. As noted in the README, we only have partial support for MacOS, unfortunately. We do not support network discovery for MacOS currently.

As for the Disk missing serial number information, can you please run the following and let us know what you get?

package main

import (
	"fmt"

	"github.com/jaypipes/ghw"
)

func main() {
	block, err := ghw.Block()
	if err != nil {
		fmt.Printf("Error getting block storage info: %v", err)
	}

	fmt.Printf("%v\n", block)

	for _, disk := range block.Disks {
		fmt.Printf(" %v\n", disk)
		if disk.SerialNumber != "" {
			fmt.Print("No serial number")
		} else {
			fmt.Printf("Serial number: %s\n", disk.SerialNumber)
		}
		for _, part := range disk.Partitions {
			fmt.Printf("  %v\n", part)
		}
	}
}

Thank you.
Here the result

Unknown block device
No disk

Screen Shot 2024-07-10 at 10 03 12 AM

I build the app with CGO_ENABLE-0 , does this affect the ghw?

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

No branches or pull requests

2 participants