sensu-plugins / sensu-plugins-http

This plugin provides native HTTP instrumentation for monitoring and metrics collection, including: response code, JSON response, HTTP last modified, SSL expiry, and metrics via `curl`.
http://sensu-plugins.io
MIT License
30 stars 97 forks source link

Problem with new version of OJ when installing the plugins on centos 7 #188

Open gvdb1967 opened 3 years ago

gvdb1967 commented 3 years ago

OS: CentOS Linux release 7.9.2009 (Core) gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

# /usr/bin/sensu-install --plugin http
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] determining if Sensu gem 'sensu-plugins-http' is already installed ...
false
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-http"]
[SENSU-INSTALL] installing Sensu gem 'sensu-plugins-http'
Building native extensions.  This could take a while...
ERROR:  Error installing sensu-plugins-http:
    ERROR: Failed to build gem native extension.

    current directory: /opt/sensu-plugins-ruby/embedded/lib/ruby/gems/2.4.0/gems/oj-3.13.1/ext/oj
/opt/sensu-plugins-ruby/embedded/bin/ruby -r ./siteconf20210812-10300-130cbet.rb extconf.rb
>>>>> Creating Makefile for ruby version 2.4.10 on x86_64-linux <<<<<
checking for rb_time_timespec()... yes
checking for rb_ivar_count()... yes
checking for rb_ivar_foreach()... yes
checking for rb_gc_mark_movable()... no
checking for stpcpy()... yes
checking for pthread_mutex_init()... yes
checking for rb_enc_associate()... yes
checking for rb_ext_ractor_safe() in ruby.h... no
checking for rb_hash_bulk_insert() in ruby.h... no
creating Makefile

current directory: /opt/sensu-plugins-ruby/embedded/lib/ruby/gems/2.4.0/gems/oj-3.13.1/ext/oj
make "DESTDIR=" clean

current directory: /opt/sensu-plugins-ruby/embedded/lib/ruby/gems/2.4.0/gems/oj-3.13.1/ext/oj
make "DESTDIR="
compiling cache.c
cache.c: In function ‘rehash’:
cache.c:115:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (Slot *sp = c->slots; sp < end; sp++) {
     ^
cache.c:115:5: note: use option -std=c99 or -std=gnu99 to compile your code
cache.c: In function ‘cache_free’:
cache.c:133:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (uint32_t i = 0; i < c->size; i++) {
     ^
cache.c:135:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (Slot s = c->slots[i]; NULL != s; s = next) {
         ^
cache.c: In function ‘cache_mark’:
cache.c:146:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (uint32_t i = 0; i < c->size; i++) {
         ^
cache.c:147:13: error: ‘for’ loop initial declarations are only allowed in C99 mode
             for (Slot s = c->slots[i]; NULL != s; s = s->next) {
             ^
make: *** [cache.o] Error 1

make failed, exit code 2

Gem files will remain installed in /opt/sensu-plugins-ruby/embedded/lib/ruby/gems/2.4.0/gems/oj-3.13.1 for inspection.
Results logged to /opt/sensu-plugins-ruby/embedded/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0/oj-3.13.1/gem_make.out
[SENSU-INSTALL] failed to install Sensu gem 'sensu-plugins-http'
[SENSU-INSTALL] you can run the sensu-install command again with --verbose for more info
[SENSU-INSTALL] please take note of any failure messages above
[SENSU-INSTALL] make sure you have build tools installed (e.g. gcc)
[SENSU-INSTALL] trying to determine the Sensu plugin homepage for sensu-plugins-http ...
homepage: https://github.com/sensu-plugins/sensu-plugins-http

See also: https://github.com/ohler55/oj/issues/689