Centos 6: nrpe-2.13-1.el6.x86_64 fails to start with init.d

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlk
Posts: 1
Joined: Mon Dec 17, 2012 3:13 pm

Centos 6: nrpe-2.13-1.el6.x86_64 fails to start with init.d

Post by dlk »

I'm using a core install of CentOS release 6.3 (Final). I have installed the nrpe-2.13-1.el6.x86_64 package.

Code: Select all

Name        : nrpe                         Relocations: (not relocatable)
Version     : 2.13                              Vendor: Fedora Project
Release     : 1.el6                         Build Date: Mon 17 Sep 2012 03:05:00 AM AKDT
Install Date: Wed 12 Dec 2012 01:08:15 PM AKST      Build Host: buildvm-28.phx2.fedoraproject.org
Group       : Applications/System           Source RPM: nrpe-2.13-1.el6.src.rpm
Size        : 285184                           License: GPLv2
Signature   : RSA/8, Fri 21 Sep 2012 11:07:47 AM AKDT, Key ID 3b49df2a0608b895
Packager    : Fedora Project
URL         : http://www.nagios.org
Summary     : Host/service/network monitoring agent for Nagios
If I attempt to start nrpe via the service command it fails:

# service nrpe start
Starting nrpe: [FAILED]

/var/log/messages:

Dec 17 10:54:40 a nrpe[21922]: Unable to open config file '/etc/nagios/nrpe.cfg' for reading
Dec 17 10:54:40 a nrpe[21922]: Config file '/etc/nagios/nrpe.cfg' contained errors, aborting...

The config file does exist:

# ls -alF /etc/nagios
total 16
drwxr-xr-x. 2 root root 4096 Dec 12 13:08 ./
drwxr-xr-x. 95 root root 4096 Dec 17 10:37 ../
-rw-r--r--. 1 root root 5120 Dec 12 13:08 nrpe.cfg

If I start nrpe manually it starts fine:

# /usr/sbin/nrpe -d -c /etc/nagios/nrpe.cfg

# ps aux | grep nrpe
nrpe 21952 0.0 0.0 40940 1220 ? Ss 11:23 0:00 /usr/sbin/nrpe -d -c /etc/nagios/nrpe.cfg

/var/log/messages:

Dec 17 11:23:58 a nrpe[21952]: Starting up daemon
Dec 17 11:23:58 a nrpe[21952]: Listening for connections on port 5666
Dec 17 11:23:58 a nrpe[21952]: Allowing connections from: a.b.c.edu

if I edit /etc/init.d/nrpe and remove "daemon" from (line 46) "daemon $NrpeBin -c $NrpeCfg -d $NRPE_SSL_OPT" services will start nrpe

# service nrpe start
Starting nrpe:
# ps aux | grep nrpe
nrpe 21982 0.0 0.0 40940 1216 ? Ss 11:30 0:00 /usr/sbin/nrpe -d -c /etc/nagios/nrpe.cfg

However daemon is important to the init.d process as it records the PID.

See http://shahmirj.com/blog/the-initd-script for a quick and simple guide on init.d.

I'm not sure why your binary doesn't play well with the daemon function, but currently the package broken under centos 6 and probably redhat 6.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Centos 6: nrpe-2.13-1.el6.x86_64 fails to start with ini

Post by scottwilkerson »

I am not actually sure as we (at Nagios Enterprises) do not build these RPM's.

I will say that we do have a pre-packaged source installer if you are running CentOS 6

http://assets.nagios.com/downloads/nagi ... _Agent.pdf
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked