Monitoring HTTPS with nagios


Hello, I am wanting to have nagios monitor HTTPS on a remote server. I have configured it correctly but I receive a returning “unknown” error that says *check_http: Invalid option - SSL is not available *:

[code]check_command check_http

define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ -S[/code]

Is this a problem with the server being monitored under this server, or is it a problem with my code?


I’d guess you are possibly missing openssl and/or openssl-devel - try installing those and then recompile the plugins




Nope still no luck. I recompiled and all that, and it still gives me the same error. I did a ./configure, make, make install for the plugin along with restarting nagios. Do you have any other ideas for this one? :-\


By Chance do I need to install openssl-doc or openssl-ibmca, are these also used by the nagios plugin?


hmmm - thought openssl and openssl-devel was enough. Perhaps the check just can’t find 'em… did you try the option to specify the openssl directory in the configure?
[blockquote]–with-openssl=DIR path to openssl installation[/blockquote]


No I hadn’t tried that. I will recompile everything with the option for the ./configure. I used locate to find the installation data for openssl, does this directory sound right /usr/bin/openssl? I choose it out of about 20 other options from the search results.


I’m not sure TBH. That would be your executable, but it isn’t clear on whether that is what it is looking for or some other directory like maybe */usr/include/openssl/ * There should be something in the output of ./configure to indicate whether or not it has been finding the openssl installation and as to whether or not SSL was included… do you get anything llike that?


Here is a return error that I received from the both the “make install” command when I recompiled the plugin with the option “–with-openssl=/user/include/openssl”:

check_http.o: In function `check_http': /opt/nagios-plugins-1.4.11/plugins/check_http.c:789: undefined reference to `np_net_ssl_read' /opt/nagios-plugins-1.4.11/plugins/check_http.c:828: undefined reference to `np_net_ssl_cleanup' /opt/nagios-plugins-1.4.11/plugins/check_http.c:785: undefined reference to `np_net_ssl_write' /opt/nagios-plugins-1.4.11/plugins/check_http.c:734: undefined reference to `np_net_ssl_init' /opt/nagios-plugins-1.4.11/plugins/check_http.c:736: undefined reference to `np_net_ssl_check_cert' /opt/nagios-plugins-1.4.11/plugins/check_http.c:737: undefined reference to `np_net_ssl_cleanup' collect2: ld returned 1 exit status make[1]: *** [check_http] Fehler 1 make[1]: Leaving directory `/opt/nagios-plugins-1.4.11/plugins' make: *** [install-recursive] Fehler 1

I will try a couple more times with several different directories and hope I get a lucky pick out of the list from locate.

If you have any other suggestions, please let me know. Does your command defintion for HTTP look the same as mine under your configuration file?


right, I’ve had a bit of a look at the script and it looks like this bit may be key:

if test x"$with_openssl" != x"/usr" ; then CPPFLAGS="$CPPFLAGS -I$with_openssl/include" LDFLAGS="$LDFLAGS -L$with_openssl/lib" fi

I think you need to tell it the where to find “/include/openssl” and “/lib/openssl” - it then goes to check it can find the following files: “openssl/ssl.h openssl/x509.h openssl/rsa.h openssl/pem.h openssl/crypto.h openssl/err.h”
… in my case that would mean using –with-openssl=/usr but that is one of the given defaults (OPENSSL_DIRS="/usr /usr/local /usr/slocal /usr/local/openssl /usr/local/ssl /opt /opt/openssl") so I guess either your lib and include directories are somewhere else or some files are ‘missing’…

[Edit: Ahhh… just seen your previous post… try [b]–with-openssl=/user - that’s definately not one of the default places it looks. hopefully we have a winner there :slight_smile: ]



I tried recompiled the plugins and it was a no go. It gave me the same errors as beforehand. Does it make a difference if I dont have the plugin compiled into the main nagios directory. For example: /opt/nagios/nagios-plugins. Or is it ok to have the plugins compiled under the */opt * directory?

[EDIT 1: I used locate on my linux machine and it didnt find the files listed in the error message I got after running [i]make and make install for the plugin, is that a bad thing?]

[EDIT 2: I just noticed that my groups under my plugin are not that same as the user and owner in my nagios directory. They are owned and assigned to the group 10002. I tried changing it as root but got an error. Would having the groups different for the plugin as for the nagios make a difference?

Hereis the code from the configuration I did for the plugin under “[i]./configure”:

--with-apt-get-command: --with-ping6-command: /bin/ping6 -n -U -w %d -c %d %s --with-ping-command: /bin/ping -n -U -w %d -c %d %s --with-ipv6: yes --with-mysql: no --with-openssl: yes --with-gnutls: no --with-perl: /usr/bin/perl --enable-perl-modules: no --with-cgiurl: /nagios/cgi-bin --with-trusted-path: /bin:/sbin:/usr/bin:/usr/sbin

So the plugin was configured with openssl!!!


I figured it out. Someone on the german nagios forums told me to run “make distclean” and recompile the plugin. It worked after that. Strides, thanks a lot for help. I really appreciate it!!!