generator folder : go build || go run main.go -> error
PS D:\git\snmp_exporter\generator> go build
github.com/prometheus/snmp_exporter/generator
.\main.go:33:28: undefined: Node .\main.go:57:30: undefined: Node .\main.go:58:28: undefined: Node .\main.go:113:22: undefined: initSNMP .\main.go:125:11: undefined: getMIBTree .\tree.go:39:18: undefined: Node .\tree.go:47:25: undefined: Node .\tree.go:203:39: undefined: Node .\tree.go:227:38: undefined: Node .\tree.go:254:52: undefined: Node .\main.go:125:11: too many errors
Is there a way to handle this?
go version ->go version go1.21.0 windows/amd64 os: window 10
Host operating system: output of uname -a
snmp_exporter version: output of snmp_exporter -version
What device/snmpwalk OID are you using?
If this is a new device, please link to the MIB(s).
What did you do that produced an error?
What did you expect to see?
What did you see instead?
A simple go build should work - at least it does on *nix.
Beware that the generator is not pure Go - it uses cgo and links against netsnmp. You will require the netsnmp libs and header files on your system. I can't really say how feasible this will be on Windows. I expect that you will need to build netsnmp from source yourself, since they (allegedly) stopped providing Windows binaries years ago.
For questions/help/support please use our community channels. There are more people available to potentially respond to your request and the whole community can benefit from the answers provided.