NRPE Install Fails on Ubuntu 16.04

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.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: NRPE Install Fails on Ubuntu 16.04

Post by avandemore »

Like @mcapra, this also works for me. I have attached a script file generated during the install. Here is a stripped out set of commands used:

Code: Select all

# cd /tmp
# wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.4.tar.gz
# apt-get install build-essential libssl-dev
# tar xzf nagios-plugins-2.1.4.tar.gz
# cd nagios-plugins-2.1.4
# ./configure
# make
# make install
# cd ..
# wget https://superb-sea2.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.1.tar.gz
# tar xzf nrpe-3.0.1.tar.gz
# cd nrpe-3.0.1
# ./configure
# make all
# make install-groups-users
# make install
# make install-config
# make install-init
# service nrpe start
# service nrpe status
Attachments
nrpe.txt
(225.93 KiB) Downloaded 435 times
Previous Nagios employee
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

avandemore wrote:Like @mcapra, this also works for me. I have attached a script file generated during the install. Here is a stripped out set of commands used:

Code: Select all

# cd /tmp
# wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.4.tar.gz
# apt-get install build-essential libssl-dev
# tar xzf nagios-plugins-2.1.4.tar.gz
# cd nagios-plugins-2.1.4
# ./configure
# make
# make install
# cd ..
# wget https://superb-sea2.dl.sourceforge.net/project/nagios/nrpe-3.x/nrpe-3.0.1.tar.gz
# tar xzf nrpe-3.0.1.tar.gz
# cd nrpe-3.0.1
# ./configure
# make all
# make install-groups-users
# make install
# make install-config
# make install-init
# service nrpe start
# service nrpe status
I tried the same steps and the result is the same:

Code: Select all

ubuntu@ip-xx-xx-xx-xx:~/nrpe-downloads/nrpe-3.0.1$ sudo make install-init
No init file to install
Makefile:93: recipe for target 'install-init' failed
make: *** [install-init] Error 1
ubuntu@ip-xxx-xx-xx-xx:~/nrpe-downloads/nrpe-3.0.1$ service nrpe start
nrpe: unrecognized service
ubuntu@ip-xxx-xx-xx-xx:~/nrpe-downloads/nrpe-3.0.1$
Is there a workaround for this?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: NRPE Install Fails on Ubuntu 16.04

Post by avandemore »

Can you generate a full script file as I did showing your commands?

You can start a script by running:

Code: Select all

# script -a /tmp/nrpe_install.txt
You can exit the script file by:

Code: Select all

# exit
Previous Nagios employee
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

I attached the nrpe 3.0.1 install file.
Attachments
nrpe_install.txt
(185.7 KiB) Downloaded 428 times
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: NRPE Install Fails on Ubuntu 16.04

Post by avandemore »

So there where a few things different in your method.
* Your script file is not very readable. This can happen when you enter into other mode changing applications like vi. There is enough interpolation and other issues that I'm not confident in what I'm reading.
* Your use of sudo. Please be root for this exercise.
* Your installation of additional packages.
* Your command line specs passed to configure may be causing issues.

Please remove these differences or use the commands I posted above exactly to do the install on a clean Ubuntu 16.04.
Previous Nagios employee
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

avandemore wrote:So there where a few things different in your method.
* Your script file is not very readable. This can happen when you enter into other mode changing applications like vi. There is enough interpolation and other issues that I'm not confident in what I'm reading.
* Your use of sudo. Please be root for this exercise.
* Your installation of additional packages.
* Your command line specs passed to configure may be causing issues.

Please remove these differences or use the commands I posted above exactly to do the install on a clean Ubuntu 16.04.
I ran your step as root and still got the same errors:

Code: Select all

root@ip-172-31-36-73:/tmp/nrpe-3.0.1# make install-init
No init file to install
Makefile:93: recipe for target 'install-init' failed
make: *** [install-init] Error 1
root@ip-172-31-36-73:/tmp/nrpe-3.0.1# service nrpe start
nrpe: unrecognized service
root@ip-172-31-36-73:/tmp/nrpe-3.0.1# service nrpe status
nrpe: unrecognized service
The nrpe install file is the same as before with all those characters.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Install Fails on Ubuntu 16.04

Post by tgriep »

I thing the error is when the configure script was ran on your system, it could not detect the init and the inetd type on your server.
Try running the configure like the example below and then run the make all and make install-init and see if that works for you.

Code: Select all

./configure --enable-command-args --with-ssl-lib=/usr/lib/x86_64-linux-gnu/  --with-init-type=systemd --with-inetd-type=systemd
Be sure to check out our Knowledgebase for helpful articles and solutions!
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

tgriep wrote:I thing the error is when the configure script was ran on your system, it could not detect the init and the inetd type on your server.
Try running the configure like the example below and then run the make all and make install-init and see if that works for you.

Code: Select all

./configure --enable-command-args --with-ssl-lib=/usr/lib/x86_64-linux-gnu/  --with-init-type=systemd --with-inetd-type=systemd

I tried that , I didn't get an error after make install-init :

Code: Select all

root@ip-xxx-xx-xx-xx:/tmp/nrpe-3.0.1# make install-init
/usr/bin/install -c -m 644 startup/default-service /lib/systemd/system/nrpe.service
But that didn't change the results:

Code: Select all

root@ip-xx-xx-xx-xx:/tmp/nrpe-3.0.1# /usr/local/nagios/libexec/check_nrpe -V

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 3.0.1
Last Modified: 09-08-2016
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: OpenSSL 0.9.6 or higher required

root@ip-xxx-xx-xx-xx:/tmp/nrpe-3.0.1# /usr/local/nagios/libexec/check_nrpe -H 127.0.0.1
connect to address 127.0.0.1 port 5666: Connection refused
connect to host 127.0.0.1 port 5666: Connection refused
I don't this as a progress since I can't start nrpe and it is still showing as:
service nrpe start
nrpe: unrecognized service


@ tgriep this is the same error as the beginning other post:https://support.nagios.com/forum/viewto ... =7&t=42894
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NRPE Install Fails on Ubuntu 16.04

Post by dwhitfield »

What is the output of cat /etc/hosts?

Also, is the result the same if you use /usr/local/nagios/libexec/check_nrpe -H localhost?

Lastly, from the Ubuntu machine, what's the output of the two following commands:

Code: Select all

nmap localhost -p 5666
netstat -l | grep 5666
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE Install Fails on Ubuntu 16.04

Post by cybergene »

What is the output of cat /etc/hosts?

Code: Select all

 cat /etc/hosts
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Also, is the result the same if you use /usr/local/nagios/libexec/check_nrpe -H localhost?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H localhost
connect to address 127.0.0.1 port 5666: Connection refused
connect to host localhost port 5666: Connection refused
Output of nmap localhost -p 5666:

Code: Select all

Nmap scan report for localhost (127.0.0.1)
Host is up (0.000082s latency).
PORT     STATE  SERVICE
5666/tcp closed nrpe

Output of netstat -l | grep 5666:

Give no result. Blank.


I checked security groups in AWS for this box and 5666 is open and I can ping my Nagios Server from this remote box and Vice Versa.
Locked