Nagios Error – CHECK_NRPE: (ssl_err != 5) Error – Could not complete SSL handshake with

There is a known error when your Nagios Monitoring Server is running Ubuntu 16.04 and you are trying to monitor a server with new version of Ubuntu like Ubuntu 18.04 with NRPE.

In 18.04 NRPE uses a 2048 bit DH key, and earlier versions of NRPE use a 512 but DH key.

This is a bit of a hack, but does work.   Firstly logon to an Ubuntu 18.04 server.   If the nagios-nrpe-plugin package is not already installed, run the following command:

 sudo apt-get install nagios-nrpe-plugin 

Now copy the /usr/lib/nagios/plugins/check_nrpe file to your Ubuntu 16.04 NRPE server.

Next Logon to your Ubuntu 16.04 NRPE server.   Now make a copy of the current check_nrpe file so you can restore it if you have any issues.

sudo mv /usr/lib/nagios/plugins/check_nrpe /usr/lib/nagios/plugins/check_nrpe.v2

Now you can copy the file your copied over to replace the current check_nrpe file.

sudo mv <location of 18.04 version of check_rpe you copied to this server> /usr/lib/nagios/plugins/check_nrpe