auxesis / cucumber-nagios

Systems testing plugin for Nagios with Cucumber + Webrat + Mechanize + Net::SSH
http://cucumber-nagios.org/
MIT License
257 stars 43 forks source link

Problem with xmlParseDoc #15

Closed Rens04 closed 14 years ago

Rens04 commented 14 years ago

Hello !

When I install cucumber-nagios on a RHEL system, I have this error :

[root@rens ~]# gem install cucumber-nagios Building native extensions. This could take a while... ERROR: Error installing cucumber-nagios: ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for libxml/parser.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for libxslt/xslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for libexslt/exslt.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/usr/include,/usr/include/libxml2,/usr/include,/usr/include/libxml2... yes checking for xmlParseDoc() in -lxml2... no libxml2 is missing. try 'port install libxml2' or 'yum install libxml2' * extconf.rb failed *

Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/bin/ruby --with-iconv-dir --without-iconv-dir --with-iconv-include --without-iconv-include=${iconv-dir}/include --with-iconv-lib --without-iconv-lib=${iconv-dir}/lib --with-xml2-dir --without-xml2-dir --with-xml2-include --without-xml2-include=${xml2-dir}/include --with-xml2-lib --without-xml2-lib=${xml2-dir}/lib --with-xslt-dir --without-xslt-dir --with-xslt-include --without-xslt-include=${xslt-dir}/include --with-xslt-lib --without-xslt-lib=${xslt-dir}/lib --with-xml2lib --without-xml2lib

Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/nokogiri-1.4.1 for inspection. Results logged to /usr/lib64/ruby/gems/1.8/gems/nokogiri-1.4.1/ext/nokogiri/gem_make.out

[root@rens ~]# yum list libxml2* Loaded plugins: rhnplugin, security Installed Packages libxml2.i386 2.6.26-2.1.2.8 installed libxml2.x86_64 2.6.26-2.1.2.8 installed libxml2-devel.i386 2.6.26-2.1.2.8 installed libxml2-devel.x86_64 2.6.26-2.1.2.8 installed libxml2-python.x86_64 2.6.26-2.1.2.8 installed

And the content of mkmf.log

find_library: checking for xmlParseDoc() in -lxml2... -------------------- no

"gcc -o conftest -I/usr/include/libxml2 -I/usr/include -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -I/opt/local/include/ -I/opt/local/include/libxml2 -I/opt/local/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -g -DXPUNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib64 -L/opt/local/lib -L. -rdynamic -Wl,-export-dynamic -lruby-static -lxml2 -lpthread -lrt -ldl -lcrypt -lm -lc " conftest.c: In function ‘t’: conftest.c:3: error: ‘xmlParseDoc’ undeclared (first use in this function) conftest.c:3: error: (Each undeclared identifier is reported only once conftest.c:3: error: for each function it appears in.) checked program was: /* begin / 1: /top/ 2: int main() { return 0; } 3: int t() { void ((volatile p)()); p = (void (()()))xmlParseDoc; return 0; } /_ end */

Where is the problem ? :/

auxesis commented 14 years ago

I'm guessing you have libxml2 (and the associated dev packages) installed?

Rens04 commented 14 years ago

Yes of course !

But at this moment the issue is resolved.

Here the end of the mkmf.log

conftest.c:3: warning: implicit declaration of function ‘xmlParseDoc’ /usr/bin/ld: skipping incompatible /usr/lib/libruby-static.a when searching for -lruby-static /usr/bin/ld: cannot find -lruby-static collect2: ld returned 1 exit status

Problem with lruby-static... I transfered an "lruby-static" file from another server and nokogiri was installed. But after I had a issue with the installation of "eventmachine".

Finally, I re-installed ruby from source and cucumber-nagios was installed successfully...

;)

auxesis commented 14 years ago

Hah ok, as long as it works. :-)

Rens04 commented 14 years ago

But it still a problem :/

When I want to launch "bin/cucumber-nagios-gen feature ebay.com.au bidding", I have the following error :

Available generators project Generate a new self-contained cucumber-nagios project.

Nevertheless I manually created a file named bidding.feature and I wrote my test.

When I launch "bin/cucumber-nagios features/ebay.com.au/bidding.feature", all works fine.

I created a command in my command.cfg file :

define command{ command_name cucumber command_line $USER1$/ebay.com.au/bin/cucumber-nagios $ARG1$ }

and the check definition :

check_command cucumber!login

but I have this issue on nagios : (Return code of 127 is out of bounds - plugin may be missing)

I tried with a script directly in the libexec directory but I have the same issue.

When I launch the scirpt with the Nagios user all works fine too...

Do you have an idea ?