sensu / monitoring-plugins

Sensu Assets for the monitoring-plugins.org project
https://monitoring-plugins.org
5 stars 17 forks source link

Several plugins do not work on CentOS 6, but do on CentOS 7 #5

Closed toozej closed 4 years ago

toozej commented 4 years ago

Several plugins from the CentOS asset package do not work on CentOS 6, but they do work as expected on CentOS 7. For example, the check_disk plugin on CentOS 6 gives the following error, both when ran from a CentOS 6 Vagrant Box, and from a CentOS 6 Docker container:

sh: relocation error: /var/cache/sensu/sensu-agent/c050df5a867675f12fce5d82b8828bad79b711e4d41bfa22f5f0dd0df7e33da5aa97acaef413b7129b8970d49e02db8f2b89e05de3be6f382cfb47da5bb3a002/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

This appears to be an issue with the version of libc the plugins are compiled with

toozej commented 4 years ago

With help from https://discourse.sensu.io/t/asset-usage-glibc-error/1219/6 and https://gist.github.com/calebhailey/ed581beb1997892f63637da45263516f I realized that the libc versions between CentOS 6 and 7 are very different. Here's sensu-agent-centos-3 is a CentOS 6 docker container:

$ docker-compose exec sensu-agent-centos-3 /bin/bash
[root@sensu-agent-centos-3 /]# ldd --version
ldd (GNU libc) 2.12
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

And sensu-agent-centos-1 is a CentOS 7 docker container:

$ docker-compose exec sensu-agent-centos-1 /bin/bash
[root@sensu-agent-centos-1 /]# ldd --version
ldd (GNU libc) 2.17
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
calebhailey commented 4 years ago

I suspect we'll need to build for more platforms. We definitely started with Centos7, so I'm not surprised at this. Perhaps it's also time to take a swing at one of the project goals here:

"Build the plugins from scratch instead of installing the distribution packages (which are inconsistent between Alpine, Debian, and CentOS)"

https://github.com/sensu/monitoring-plugins#next-steps

toozej commented 4 years ago

I'd be happy to take a stab at building them from the source provided at monitoring-plugins.org.

In the mean time https://github.com/sensu/monitoring-plugins/pull/6 makes a working CentOS 6 version of the plugins