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

Unable to build the source #4

Open
saurabhnanda opened this issue Nov 20, 2020 · 1 comment
Open

Unable to build the source #4

saurabhnanda opened this issue Nov 20, 2020 · 1 comment

Comments

@saurabhnanda
Copy link

Does this plugin work with any specific version of collectd?

Error:

root@ca151d987f52:~/collectd-mod-haproxy# make
cc -DHAVE_CONFIG_H -I/usr/include/collectd/  -Wall -Werror -g -O2 -c haproxy.c  -fPIC -DPIC -o haproxy.o
haproxy.c:29:10: fatal error: collectd.h: No such file or directory
 #include "collectd.h"
          ^~~~~~~~~~~~
compilation terminated.
Makefile:8: recipe for target 'bin' failed
make: *** [bin] Error 1

The file is there, but probably in a different location:

root@ca151d987f52:/usr/lib# find /usr -iname 'collectd.h'
/usr/include/collectd/core/daemon/collectd.h

Ubuntu version:

root@ca151d987f52:~# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

collectd version:

root@ca151d987f52:~# apt-cache show collectd
Package: collectd
Architecture: amd64
Version: 5.7.2-2ubuntu1.2

collectd-dev version:

root@ca151d987f52:~# apt-cache show collectd-dev    
Package: collectd-dev
Architecture: all
Version: 5.7.2-2ubuntu1.2

Haproxy version (if it matters):

root@ca151d987f52:~# haproxy --version
HA-Proxy version 1.8.8-1ubuntu0.11 2020/06/22
@saurabhnanda
Copy link
Author

I've gotten this to compile by making the following changes, but since I'm not a C programmer, I'm a little skeptical or running the resulting .so file in production. Is it safe?

#include "collectd/core/daemon/collectd.h"
#include "collectd/core/daemon/common.h"
#include "collectd/core/daemon/plugin.h"
#include "collectd/core/daemon/configfile.h"

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

1 participant