check_http perl script not working with SSL ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: check_http perl script not working with SSL ?

Post by reinaldo.gomes »

I did

Code: Select all

cd /tmp
wget https://github.com/nagios-plugins/nagios-plugins/archive/timeout_state.zip
unzip timeout_state
cd nagios-plugins-timeout_state
and then

Code: Select all

[root@localhost nagios-plugins-timeout_state]# ./tools/setup
which: no gnumake in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/root/bin)
Found GNU Make at /usr/bin/gmake ... good.
./tools/setup: line 30: aclocal: command not found
./tools/setup: line 32: autoheader: command not found
./tools/setup: line 33: automake: command not found
./tools/setup: line 34: autoconf: command not found
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_http perl script not working with SSL ?

Post by abrist »

You need to install the auomake package. If you are using centos:

Code: Select all

yum install automake -y
For debian and friends:

Code: Select all

apt-get install automake
Then try to recompile.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: check_http perl script not working with SSL ?

Post by reinaldo.gomes »

I installed the automake and so I was able to run the ./tools/setup and then the ./configure
But I still got the same output when running check_http (timeout interval must be a positive integer).

Also, I got some error messages at the end of the compiling:

Code: Select all

Making all in plugins-root
make[2]: Entering directory `/tmp/nagios-plugins-timeout_state/plugins-root'
2.0.1.git
NP_VERSION = 2.0.1.git
make[2]: Leaving directory `/tmp/nagios-plugins-timeout_state/plugins-root'
make[2]: Entering directory `/tmp/nagios-plugins-timeout_state/plugins-root'
2.0.1.git
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I.. -I../lib -I../gl -I../intl -I../plugins -I/usr/include  -DNP_VERSION='"2.0.1.git"' -g -O2 -MT check_dhcp.o -MD -MP -MF .deps/check_dhcp.Tpo -c -o check_dhcp.o check_dhcp.c
mv -f .deps/check_dhcp.Tpo .deps/check_dhcp.Po
/bin/sh ../libtool --tag=CC   --mode=link gcc -DNP_VERSION='"2.0.1.git"' -g -O2  -L. -o check_dhcp check_dhcp.o ../plugins/netutils.o ../plugins/utils.o ../lib/libnagiosplug.a ../gl/libgnu.a  -lnsl -lresolv -lpthread -ldl
libtool: link: gcc -DNP_VERSION=\"2.0.1.git\" -g -O2 -o check_dhcp check_dhcp.o ../plugins/netutils.o ../plugins/utils.o  -L. ../lib/libnagiosplug.a ../gl/libgnu.a -lnsl -lresolv -lpthread -ldl
gcc -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I.. -I../lib -I../gl -I../intl -I../plugins -I/usr/include  -DNP_VERSION='"2.0.1.git"' -g -O2 -MT check_icmp.o -MD -MP -MF .deps/check_icmp.Tpo -c -o check_icmp.o check_icmp.c
mv -f .deps/check_icmp.Tpo .deps/check_icmp.Po
/bin/sh ../libtool --tag=CC   --mode=link gcc -DNP_VERSION='"2.0.1.git"' -g -O2  -L. -o check_icmp check_icmp.o ../plugins/netutils.o ../plugins/utils.o ../lib/libnagiosplug.a ../gl/libgnu.a  -lnsl -lresolv -lnsl -lresolv -lpthread -ldl
libtool: link: gcc -DNP_VERSION=\"2.0.1.git\" -g -O2 -o check_icmp check_icmp.o ../plugins/netutils.o ../plugins/utils.o  -L. ../lib/libnagiosplug.a ../gl/libgnu.a -lnsl -lresolv -lpthread -ldl
make[2]: Leaving directory `/tmp/nagios-plugins-timeout_state/plugins-root'
Making all in po
make[2]: Entering directory `/tmp/nagios-plugins-timeout_state/po'
test ! -f ./nagios-plugins.pot || \
          test -z "fr.gmo de.gmo" || make fr.gmo de.gmo
make[3]: Entering directory `/tmp/nagios-plugins-timeout_state/po'
rm -f fr.gmo && : -c --statistics -o fr.gmo fr.po
mv: cannot stat `t-fr.gmo': No such file or directory
make[3]: *** [fr.gmo] Error 1
make[3]: Leaving directory `/tmp/nagios-plugins-timeout_state/po'
make[2]: *** [stamp-po] Error 2
make[2]: Leaving directory `/tmp/nagios-plugins-timeout_state/po'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/nagios-plugins-timeout_state'
make: *** [all] Error 2
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_http perl script not working with SSL ?

Post by abrist »

The compile failed too early. You are also missing the package "gettext":

Code: Select all

yum install gettext -y
Or:

Code: Select all

apt-get install gettext
Rerun the configure, make, and make install steps afterwards.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: check_http perl script not working with SSL ?

Post by reinaldo.gomes »

after installing gettext I did this again:

Code: Select all

./tools/setup
./configure
make
make all
this time with no errors:

Code: Select all

make[2]: Entering directory `/tmp/nagios-plugins-timeout_state/po'
test ! -f ./nagios-plugins.pot || \
          test -z "fr.gmo de.gmo" || make fr.gmo de.gmo
make[3]: Entering directory `/tmp/nagios-plugins-timeout_state/po'
rm -f fr.gmo && /usr/bin/msgfmt -c --statistics -o fr.gmo fr.po
844 translated messages, 3 fuzzy translations, 397 untranslated messages.
rm -f de.gmo && /usr/bin/msgfmt -c --statistics -o de.gmo de.po
87 translated messages, 163 fuzzy translations, 994 untranslated messages.
make[3]: Leaving directory `/tmp/nagios-plugins-timeout_state/po'
touch stamp-po
make[2]: Leaving directory `/tmp/nagios-plugins-timeout_state/po'
make[2]: Entering directory `/tmp/nagios-plugins-timeout_state'
make[2]: Leaving directory `/tmp/nagios-plugins-timeout_state'
make[1]: Leaving directory `/tmp/nagios-plugins-timeout_state'
but still getting the 'positive integer needed' message from check_http.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_http perl script not working with SSL ?

Post by abrist »

My bad. My last post said "make all" instead of "make install". And I edited it, so no, you are not going crazy. At least not *this* time :P
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_http perl script not working with SSL ?

Post by sreinhardt »

I didn't see a "make install" there, which would leave the plugins built but still in the install directory and the original check_http still in place. So you have two choices.
1) move back into the directory where you were building the plugins and run make install. Then test from your standard plugins path.
2) test the new binaries from the path where you currently have them (we'll use /tmp) with something like:
cd /tmp/nagios-plugins-timeout_state/plugins
check_http -V ( to check the current version, should be 2.0.3-dirty or something similar)

I would suggest option 1, since you will in all likely-hood want to switch to the newer plugins anyway.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: check_http perl script not working with SSL ?

Post by reinaldo.gomes »

Finally, now it works.
Just to make things clear: using the wrapped 2.0.3 version, I had a specific "CRITICAL - Socket timeout" string, so this was the only timeout message meant to return UNKNOWN state instead of CRITICAL.
Now, with the git's 2.0.1, all timeout-related messages will return UNKNOWN state instead of CRITICAL, right?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check_http perl script not working with SSL ?

Post by abrist »

Timeouts, by default will still return a CRITICAL. But using the timeout syntax, you can set those checks to return UNKNOWN on timeout:

Code: Select all

./check_http localhost -t :unknown
Even though the plugins report version 2.0.1, they are indeed a different branch (and have had commits post 2.0.1 merged into them). These changes will be pulled into the nagios-plugins master branch at some point.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
reinaldo.gomes
Posts: 59
Joined: Wed Apr 02, 2014 9:29 am

Re: check_http perl script not working with SSL ?

Post by reinaldo.gomes »

abrist wrote:Timeouts, by default will still return a CRITICAL. But using the timeout syntax, you can set those checks to return UNKNOWN on timeout
That's what I meant, thank you.

How do I know when Git's changes are commited to the master branch?
Locked