Page 1 of 1

Could not complete SSL handshake [gelöst]

Posted: 2012-03-09 17:02
by splitti
Hallo,

ich bin gerade dabei, mit meinen Domains von einem Root-Server (OpenSuse11) auf einen virtual-Server (CentOS5) umzuziehen.

Zu Hause hab ich einen Debian-Server mit Nagios. Den Root-Server hab ich mittels nrpe überwacht. Leider bekomme ich das auf dem virtual Server nicht hin.

Installiert hab ich dort nrpe mittels yum. Ich bin mir recht sicher, das die Konfigs passen, auch die allowed_hosts sind richtig.

Bei jedem NRPE-Zugriff zeigt mir der Server nur

Code: Select all

Mar  9 16:54:25 vserver nrpe[17853]: Error: Could not complete SSL handshake. 1
und der client

Code: Select all

NRPE: Unable to read output
Wenn ich beim client noch "-n" (no ssl) setzte kommt

Code: Select all

HECK_NRPE: Error receiving data from daemon.
Da sich beim Client nichts geändert hat, vermute ich den Fehler beim Server. Leider bekomme ich dort NRPE nicht selber kompiliert.

Code: Select all

root-> make
cd ./src/; make ; cd ..
make[1]: Entering directory `/tmp/a/nrpe-2.13/src'
gcc -g -O2 -I/usr/include/openssl -I/usr/include -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c acl.c -L/usr/lib  -lssl -lcrypto -lnsl -lwrap
In file included from /usr/include/openssl/e_os2.h:56,
                 from /usr/include/openssl/asn1.h:63,
                 from /usr/include/openssl/rsa.h:62,
                 from ../include/config.h:238,
                 from ../include/common.h:24,
                 from nrpe.c:27:
/usr/include/openssl/opensslconf.h:25:32: error: opensslconf-x86_64.h: No such file or directory
In file included from /usr/include/openssl/asn1.h:74,
                 from /usr/include/openssl/rsa.h:62,
                 from ../include/config.h:238,
                 from ../include/common.h:24,
                 from nrpe.c:27:
/usr/include/openssl/bn.h:288: error: expected specifier-qualifier-list before âBN_ULONGâ
/usr/include/openssl/bn.h:304: error: expected specifier-qualifier-list before âBN_ULONGâ
/usr/include/openssl/bn.h:450: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âBN_mod_wordâ
/usr/include/openssl/bn.h:451: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âBN_div_wordâ
/usr/include/openssl/bn.h:452: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:453: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:454: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:455: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:456: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âBN_get_wordâ
/usr/include/openssl/bn.h:471: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:764: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_mul_add_wordsâ
/usr/include/openssl/bn.h:765: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_mul_wordsâ
/usr/include/openssl/bn.h:766: error: expected â)â before â*â token
/usr/include/openssl/bn.h:767: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_div_wordsâ
/usr/include/openssl/bn.h:768: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_add_wordsâ
/usr/include/openssl/bn.h:769: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_sub_wordsâ
In file included from /usr/include/openssl/ssl.h:1010,
                 from ../include/config.h:242,
                 from ../include/common.h:24,
                 from nrpe.c:27:
/usr/include/openssl/ssl3.h:306: error: expected specifier-qualifier-list before âPQ_64BITâ
In file included from /usr/include/openssl/dtls1.h:64,
                 from /usr/include/openssl/ssl.h:1012,
                 from ../include/config.h:242,
                 from ../include/common.h:24,
                 from nrpe.c:27:
/usr/include/openssl/pqueue.h:73: error: expected specifier-qualifier-list before âPQ_64BITâ
/usr/include/openssl/pqueue.h:80: error: expected â)â before âpriorityâ
/usr/include/openssl/pqueue.h:89: error: expected declaration specifiers or â...â before âPQ_64BITâ
In file included from /usr/include/openssl/ssl.h:1012,
                 from ../include/config.h:242,
                 from ../include/common.h:24,
                 from nrpe.c:27:
/usr/include/openssl/dtls1.h:92: error: expected specifier-qualifier-list before âPQ_64BITâ
In file included from /usr/include/openssl/e_os2.h:56,
                 from /usr/include/openssl/asn1.h:63,
                 from /usr/include/openssl/rsa.h:62,
                 from ../include/config.h:238,
                 from ../include/common.h:24,
                 from utils.c:32:
/usr/include/openssl/opensslconf.h:25:32: error: opensslconf-x86_64.h: No such file or directory
In file included from /usr/include/openssl/asn1.h:74,
                 from /usr/include/openssl/rsa.h:62,
                 from ../include/config.h:238,
                 from ../include/common.h:24,
                 from utils.c:32:
/usr/include/openssl/bn.h:288: error: expected specifier-qualifier-list before âBN_ULONGâ
/usr/include/openssl/bn.h:304: error: expected specifier-qualifier-list before âBN_ULONGâ
/usr/include/openssl/bn.h:450: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âBN_mod_wordâ
/usr/include/openssl/bn.h:451: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âBN_div_wordâ
/usr/include/openssl/bn.h:452: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:453: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:454: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:455: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:456: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âBN_get_wordâ
/usr/include/openssl/bn.h:471: error: expected declaration specifiers or â...â before âBN_ULONGâ
/usr/include/openssl/bn.h:764: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_mul_add_wordsâ
/usr/include/openssl/bn.h:765: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_mul_wordsâ
/usr/include/openssl/bn.h:766: error: expected â)â before â*â token
/usr/include/openssl/bn.h:767: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_div_wordsâ
/usr/include/openssl/bn.h:768: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_add_wordsâ
/usr/include/openssl/bn.h:769: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âbn_sub_wordsâ
In file included from /usr/include/openssl/ssl.h:1010,
                 from ../include/config.h:242,
                 from ../include/common.h:24,
                 from utils.c:32:
/usr/include/openssl/ssl3.h:306: error: expected specifier-qualifier-list before âPQ_64BITâ
In file included from /usr/include/openssl/dtls1.h:64,
                 from /usr/include/openssl/ssl.h:1012,
                 from ../include/config.h:242,
                 from ../include/common.h:24,
                 from utils.c:32:
/usr/include/openssl/pqueue.h:73: error: expected specifier-qualifier-list before âPQ_64BITâ
/usr/include/openssl/pqueue.h:80: error: expected â)â before âpriorityâ
/usr/include/openssl/pqueue.h:89: error: expected declaration specifiers or â...â before âPQ_64BITâ
In file included from /usr/include/openssl/ssl.h:1012,
                 from ../include/config.h:242,
                 from ../include/common.h:24,
                 from utils.c:32:
/usr/include/openssl/dtls1.h:92: error: expected specifier-qualifier-list before âPQ_64BITâ
make[1]: *** [nrpe] Error 1
make[1]: Leaving directory `/tmp/a/nrpe-2.13/src'

*** Compile finished ***

If the NRPE daemon and client compiled without any errors, you
can continue with the installation or upgrade process.

Read the PDF documentation (NRPE.pdf) for information on the next
steps you should take to complete the installation or upgrade.
Ich weiß einfach nicht mehr, wo ich noch suchen soll?!

Re: Could not complete SSL handshake

Posted: 2012-03-09 17:40
by Joe User
Helfen Dir folgende Links?
http://projects.arcs.org.au/trac/system ... NagiosNRPE
http://askaralikhan.blogspot.com/2010/0 ... pe-on.html
http://darktraining.com/linux/30/

Beim Kompilieren versucht er Header für 64Bit zu finden, die existtieren aber nicht.

Re: Could not complete SSL handshake

Posted: 2012-03-09 17:52
by splitti
Die Links haben mich nicht weiter gebracht. Ich hab nrpe jetzt mit "--without-ssl" compiliert bekommen. Aber auch mit dem selbst erstellten nrpe kommt nur die selbe Fehlermeldung.

Ich bin aber trotzdem einen Schritt weiter. Ein einfaches

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H remoteserver
gibt mir die Versionsnummer des Servers zurück. Nur sobald ich mit -c einen command mit schicke, kommt die Fehlermeldung.
Ich vermute mal, das es an irgendwelchen Berechtigungen liegt?!

Re: Could not complete SSL handshake

Posted: 2012-03-09 17:58
by ddm3ve
Die Zugriffberechtigung stimmt nicht.
Entweder läuft der dienst nicht auf dem Port oder Du darfst nicht darauf zugreifen.

Du musst in der nrpe.conf folgende Zeile um die IP des überwachenden Host anpassen.
Bei mir sieht es so aus:

allowed_hosts=10.29.136.14,10.29.136.15

2 Nagios Hosts (Server) welche die nrpe checks ausführen.
10.29.136.14
und
10.29.136.15


der zu überwachende Rechner hat die IP:
10.29.136.9

Falls nrpe nicht als Server läuft sondern per xinet.d angesartet werden muss auch in der passende Konfiguration der zugriff erlaubt werden.
/etc/xinetd.d/nrpe

z.B. mit:
only_from = 127.0.0.1

Code: Select all

# default: off
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream    
        type            = UNLISTED
        interface       = 10.29.136.9
        port            = 5666    
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/sbin/nrpe
        server_args     = -c /etc/nagios/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no
        #only_from       = 127.0.0.1
}
Beim externen Zugriff, das wurde bei mir über eine interne private IP und vlan gelöst, solltest Du das only_from explizit setzen.

Beide dienste neu starten und es sollte funktionieren.

Re: Could not complete SSL handshake

Posted: 2012-03-09 18:54
by splitti
So, das Problem ist gelöst.
Ich hatte in der nrpe.config "command_prefix=/usr/bin/sudo" gesetzt. Der User war auch in /etc/sudoers eingetragen.
Hab die Option jetzt raus genommen und lasse alle commands unter dem User nagios laufen.
Läuft jetzt alles problemlos, Danke!