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

collector: add NetBSD support for netdev #3078

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tnn2
Copy link
Contributor

@tnn2 tnn2 commented Jul 28, 2024

It's similar to the other BSD collectors but we have to do a special sysctl dance to read ifi_oqdrops.

@discordianfish
Copy link
Member

Build fails:

# github.com/prometheus/node_exporter/collector
collector/netdev_netbsd.go:33:10: fatal error: sys/sysctl.h: No such file or directory
   33 | #include <sys/sysctl.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
!! command failed: build -o .build/netbsd-386/node_exporter -ldflags -X github.com/prometheus/common/version.Version=1.8.1 -X github.com/prometheus/common/version.Revision=e8dd999618cea83b8213e5a63fe956b5ecb4fe6d -X github.com/prometheus/common/version.Branch=pull/3078 -X github.com/prometheus/common/version.BuildUser=root@d3958b0be1a1 -X github.com/prometheus/common/version.BuildDate=20240728-00:51:43  -extldflags '-static' github.com/prometheus/node_exporter: exit status 1
make: *** [Makefile.common:204: common-build] Error 1
!! The main builder docker image exited unexpectedly: exit status 2

Exited with code exit status 1

@tnn2
Copy link
Contributor Author

tnn2 commented Sep 23, 2024

collector/netdev_netbsd.go:33:10: fatal error: sys/sysctl.h: No such file or directory
33 | #include <sys/sysctl.h>
| ^~~~~~~~~~~~~~
compilation terminated.

I can't reproduce this. sys/sysctl.h is definitely a file that should exist.
It might be a problem with the build environment but I cannot say
what the problem is. I noticed the build log has

CC='i686-linux-gnu-gcc'

Does this job even build a NetBSD binary?

@discordianfish
Copy link
Member

@tnn2 this is from crosscompiling using promu:

Using this config: https://github.com/prometheus/node_exporter/blob/master/.promu-cgo.yml

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