unable to start NRPE

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.
smlushing
Posts: 11
Joined: Thu Oct 26, 2017 8:18 am

unable to start NRPE

Post by smlushing »

Moderator Edit: This thread has been split from another - https://support.nagios.com/forum/viewto ... =7&t=35904
In the future, please create a new thread and link to the old one instead of adding on.


I have the same problem as al of a sudden it created this error in my messages as I am running OEL Linux 6

Oct 26 09:06:49 lxbandt2 xinetd[16527]: START: nrpe pid=16726 from=::ffff:147.4.4.226
Oct 26 09:06:49 lxbandt2 nrpe[16727]: Warning: Could not set effective GID=979
Oct 26 09:06:49 lxbandt2 nrpe[16727]: Warning: Unable to change supplementary groups using initgroups()
Oct 26 09:06:49 lxbandt2 nrpe[16727]: Warning: Could not set UID=985
Oct 26 09:06:49 lxbandt2 xinetd[16527]: EXIT: nrpe status=0 pid=16726 duration=0(sec)


Did anyone give an answer why

steve lushing
Hofstra University
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: unable to start NRPE

Post by dwhitfield »

What's the output of grep pid /etc/nagios/nrpe.cfg?

Whatever file is there, can you also provide the permissions?

If the file does not exist, then you need to find the pid and change the pid_file directive.

The following commands may be helpful in locating the pid if it is not in the location defined above

Code: Select all

ll -la /var/run/nagios/
ll -la /var/run/
Please put the output in a code block. The "Code" button is the fifth from the left on the post input screen (between Quote and List).

Is the log section you posted the first place this shows up in the log? It would be useful to figure out when this started so we can pinpoint what caused it.
smlushing
Posts: 11
Joined: Thu Oct 26, 2017 8:18 am

Re: unable to start NRPE

Post by smlushing »

Code: Select all

[root@lxbandt2 nrpe]# ll -la /var/run/nagios/
total 12
drwxr-x---   2 nagios nagios 4096 Oct 24 23:40 .
drwxr-xr-x. 35 root   root   4096 Oct 27 00:56 ..
-rw-r--r--   1 nagios    558    6 Oct 24 23:40 nagios.pid

[root@lxbandt2 run]# ll -la /var/run/
total 252
drwxr-xr-x. 35 root      root      4096 Oct 27 00:56 .
drwxr-xr-x. 25 root      root      4096 Aug  9  2016 ..
drwxr-xr-x.  2 root      root      4096 Oct 24 23:40 abrt
-rw-r--r--   1 root      root         6 Oct 24 23:40 abrtd.pid
-rw-r--r--   1 root      root         6 Oct 24 23:40 acpid.pid
srw-rw-rw-   1 root      root         0 Oct 24 23:40 acpid.socket
-rw-r--r--   1 root      root         6 Oct 24 23:40 atd.pid
-rw-r--r--   1 root      root         6 Oct 24 23:40 auditd.pid
prw-------   1 root      root         0 Oct 24 23:40 autofs.fifo-misc
prw-------   1 root      root         0 Oct 24 23:40 autofs.fifo-net
-rw-r--r--   1 root      root         6 Oct 24 23:40 autofs.pid
----------   1 root      root         6 Oct 24 23:40 autofs-running
-rw-r--r--   1 root      root         6 Oct 24 23:40 bmc-watchdog.pid
drwxr-xr-x.  3 root      root      4096 Jan 10  2017 certmonger
-rw-------   1 root      root         6 Oct 24 23:40 certmonger.pid
drwxr-xr-x.  2 root      root      4096 Jan 11  2017 cluster
drwxr-xr-x.  2 root      root      4096 Mar 23  2017 console
drwxr-xr-x.  2 root      root      4096 Oct 24 23:50 ConsoleKit
-rw-r--r--   1 root      root         6 Oct 24 23:40 console-kit-daemon.pid
-rw-r--r--   1 root      root         6 Oct 24 23:40 crond.pid
----------   1 root      root         0 Oct 24 23:40 cron.reboot
drwxr-xr-x.  3 root      lp        4096 Oct 24 23:40 cups
-rw-r--r--   1 root      root         6 Oct 24 23:40 cupsd.pid
drwxr-xr-x.  2 root      root      4096 Oct 24 23:40 dbus
drwxr-xr-x.  2 root      root      4096 Mar 23  2017 faillock
drwx--x--x.  4 root      gdm       4096 Oct 24 23:50 gdm
-rw-r--r--   1 root      root         6 Oct 24 23:40 gdm.pid
drwx------.  2 haldaemon haldaemon 4096 Aug 17  2014 hald
-rw-r--r--   1 root      root         6 Oct 24 23:40 haldaemon.pid
drwx--x---.  2 root      apache    4096 Aug 15 18:13 httpd
-rw-r--r--   1 root      root         6 Oct 24 23:40 irqbalance.pid
drwx------.  2 root      root      4096 Mar 21  2017 lvm
srwxr-xr-x   1 root      root         0 Oct 24 23:40 mcelog-client
-rw-r--r--   1 root      root         5 Oct 24 23:40 mcelog.pid
drwx------.  2 root      root      4096 Mar 22  2017 mdadm
-rw-r--r--   1 root      root         6 Oct 24 23:40 messagebus.pid
-rw-r--r--   1 root      root         4 Oct 24 23:39 multipathd.pid
srwx------   1 root      root         0 Oct 24 23:39 multipathd.sock
drwxr-xr-x.  2 mysql     mysql     4096 Jan 24  2017 mysqld
drwxr-x---   2 nagios    nagios    4096 Oct 24 23:40 nagios
drwxrwxr-x.  2 root      root      4096 May 30 22:55 netreport
drwxrwxr-x   2 nrpe      nrpe      4096 Oct 27 10:25 nrpe
drwxr-xr-x.  2 root      root      4096 Jun 19 15:48 nscd
drwxr-xr-x.  2 nslcd     root      4096 Mar 24  2016 nslcd
-rw-r--r--   1 root      root         5 Oct 24 23:40 ntpd.pid
drwx------.  2 root      root      4096 Mar 22  2017 pluto
drwxr-xr-x.  2 root      root      4096 Jan 11  2017 plymouth
drwxr-xr-x.  5 root      root      4096 Feb  5  2016 pm-utils
drwxr-xr-x.  2 root      root      4096 Oct 24 23:40 portreserve
drwxr-xr-x.  2 root      root      4096 May  7  2015 ppp
drwxr-xr-t.  2 root      root      4096 Mar 22  2017 resource-agents
-r--r--r--   1 root      root         0 Oct 24 23:40 rpcbind.lock
-rw-r--r--   1 root      root         6 Oct 24 23:40 rpcbind.pid
srw-rw-rw-   1 root      root         0 Oct 24 23:40 rpcbind.sock
-rw-r--r--   1 rpcuser   rpcuser      6 Oct 24 23:40 rpc.statd.pid
drwxr-xr-x.  2 root      root      4096 Mar 25  2015 saslauthd
drwxrwxr-x.  2 root      screen    4096 Mar 22  2016 screen
-rw-------   1 root      smmsp       34 Oct 24 23:40 sendmail.pid
drwxr-xr-x.  2 root      root      4096 Mar 23  2017 sepermit
drwxr-xr-x.  2 root      root      4096 May 11  2016 setrans
-rw-r--r--   1 smmsp     smmsp       50 Oct 24 23:40 sm-client.pid
-rw-------   1 root      root         6 Oct 24 23:40 sm-notify.pid
drwxr-xr-x.  2 root      root      4096 Mar 22  2017 spice-vdagentd
-rw-r--r--   1 root      root         6 Oct 24 23:40 sshd.pid
-rw-------   1 root      root         6 Oct 24 23:40 syslogd.pid
drwx------.  2 root      root      4096 Jan 11  2017 udisks
-rw-rw-r--   1 root      utmp      4224 Oct 27 10:20 utmp
drwxr-xr-x.  2 root      root      4096 Aug 22 12:44 winbindd
drwxr-xr-x.  2 root      root      4096 Jan 10  2017 wpa_supplicant
-rw-r--r--   1 root      root         6 Oct 26 09:06 xinetd.pid

[root@lxbandt2 run]# grep pid /etc/nagios/nrpe.cfg
pid_file=/var/run/nrpe/nrpe.pid
When I restarted the daemon - this was the output above. Also I got this error

Code: Select all

Oct 27 10:21:28 lxbandt2 nrpe[53798]: Starting up daemon
Oct 27 10:21:28 lxbandt2 nrpe[53798]: Bind to port 5666 on 0.0.0.0 failed: Address already in use.
Oct 27 10:21:28 lxbandt2 nrpe[53798]: Bind to port 5666 on :: failed: Address already in use.
Oct 27 10:21:28 lxbandt2 nrpe[53798]: Cannot bind to any address.
Since I am sort of new at this nagios - I am trying to figure out why as on the Nagios IX gui - the status of the server is showing green.

Also since I just register - I did not see a button for new post which is why I sort of put it on another person post. It seems like I can post replys but no open new post.

Thanks in advance
smlushing
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: unable to start NRPE

Post by dwhitfield »

It looks to me like NRPE is already started. How did you install NRPE?

Also, you posted in Nagios Core, but then mention XI. If this is XI, can you PM me your Profile? You can download it by going to Admin > System Config > System Profile and click the ***Download Profile*** button towards the top. If for whatever reason you *cannot* download the profile, please put the output of View System Info (5.3.4+, Show Profile if older) in the thread (that will at least get us some info). This will give us access to many of the logs we would otherwise ask for individually. If security is a concern, you can unzip the profile take out what you like, and then zip it up again. We may end up needing something you remove, but we can ask for that specifically.

You can also generate a profile manually using the script at /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh

That should generate a profile in /usr/local/nagiosxi/var/components/ which you can get off the server with an application such as FileZilla.

After you PM the profile, please update this thread. Updating this thread is the only way for it to show back up on our dashboard.

If you get an error that PROFILE BUILD FAILED, please see https://support.nagios.com/kb/article.p ... ategory=44
smlushing
Posts: 11
Joined: Thu Oct 26, 2017 8:18 am

Re: unable to start NRPE

Post by smlushing »

This server has the original nagios core but the university brought Nagios IX. So I ran and the

command --> yum install nrpe nagios-plugins-all -y

and then

Once the installation of the Nagios packages are installed, edit the NRPE configuration file located at /etc/nagios/nrpe.cfg.

Find the line starting with allowed_hosts= and replace it with the following:
allowed_hosts=127.0.0.1,147.4.4.225,147.4.145.26

Start and enable the NRPE service:
systemctl start nrpe
systemctl enable nrpe

I will send the profile when I get a chance


Steve LuShing
smlushing
Posts: 11
Joined: Thu Oct 26, 2017 8:18 am

Re: unable to start NRPE

Post by smlushing »

Enclose is the profile you have asked


Thanks

steve lushing
Attachments
profile.zip
Here is the system profile from the Nagios IX GUI
(81.47 KiB) Downloaded 242 times
Last edited by Anonymous on Mon Oct 30, 2017 9:57 am, edited 2 times in total.
Reason: Profile received!
kyang

Re: unable to start NRPE

Post by kyang »

What version of NRPE are you running?

Code: Select all

cd /usr/local/nagios/etc/libexec
./check_nrpe -V
Can you add those IP addresses into this file under the allowed_hosts and restart nrpe.

Code: Select all

/usr/local/nagios/etc/nrpe.cfg

Code: Select all

service nrpe restart
Check to see if NRPE is listening and responding.

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 
smlushing
Posts: 11
Joined: Thu Oct 26, 2017 8:18 am

Re: unable to start NRPE

Post by smlushing »

Here is the following output as the command is currently located at /usr/lib64/nagios/plugins as I had said that we converted from Nagios Core to Nagios IX.
So the command in /usr/local/nagios no longer exist as the nrpe.cfg is in /etc/nagios and the command is in /usr/lib64/nagios/plugins. This was created when
did the installation.

What version of NRPE are you running?

Code: Select all

cd /usr/local/nagios/etc/libexec
./check_nrpe -V

[b][root@lxbandt2 plugins]# ./check_nrpe -V

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 3.1.1
Last Modified: 2017-05-24
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: OpenSSL 0.9.6 or higher required[/b]
Can you add those IP addresses into this file under the allowed_hosts and restart nrpe.

The IP are added to the nrpe.cfg file as shown

Code: Select all

[root@lxbandt2 netsml]# cd /etc/nagios

[root@lxbandt2 nagios]# ls
cgi.cfg  generic-service.cfg  lcgdm-hosts.cfg     nagios.cfg  nrpe.cfg  passwd
conf.d   lcgdm-commands.cfg   lcgdm-services.cfg  NOT-USED    objects   private

[root@lxbandt2 nagios]# grep allowed_hosts nrpe.cfg
allowed_hosts=127.0.0.1,147.4.145.26,147.4.4.226

I restarted the daemon and did a verification. The only thing is that the nrpe seems to failed and I am not sure why

Code: Select all

[root@lxbandt2 plugins]# /sbin/service nrpe restart
Shutting down nrpe                                         [FAILED]
Starting nrpe                                              [  OK  ]

[root@lxbandt2 plugins]# ./check_nrpe -H 127.0.0.1
NRPE v3.1.1
ON ANOTHER NOTE:
Who can I contact to find out why I cannot read or post a question to the Customer Support Forum as it said I have no permission. I had ask my boss and
he inform me that we do have a NAGIOS IX support contract. I would like to access the customer support forum to see other
post that may help me understand NAGIOS IX.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: unable to start NRPE

Post by npolovenko »

Hello, @smlushing.
Can you turn on debugging option in /usr/local/nagios/etc/nrpe.cfg
Change

Code: Select all

debug=0
to
debug=1
Bind to port 5666 on 0.0.0.0 failed: Address already in use.
You may have been running multiple NRPE processes at the same time.
Can you run:
ps -ef | grep nrpe | grep -v grep
if you see any nrpe processes please run this command:
killall -9 nrpe
Also, please run:
ps -ef | grep xinetd | grep -v grep

After you killed nrpe process please attempt to start nrpe again.
Also, can you run service nrpe restart?
Check your syslog if it has any entries from the debug mode that we enabled earlier.
ON ANOTHER NOTE:
Who can I contact to find out why I cannot read or post a question to the Customer Support Forum as it said I have no permission. I had ask my boss and
he inform me that we do have a NAGIOS IX support contract. I would like to access the customer support forum to see other
post that may help me understand NAGIOS IX.
Please send an email with your forum ID to sales@nagios.com, from your customer associated email adress.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
smlushing
Posts: 11
Joined: Thu Oct 26, 2017 8:18 am

Re: unable to start NRPE

Post by smlushing »

I ran the command you asked and here are the results

Code: Select all

[

[root@lxbandt2 log]# ps -ef | grep nrpe | grep -v grep

[root@lxbandt2 log]# ps -ef | grep xinetd | grep -v grep
root     18418     1  0 Oct27 ?        00:00:10 xinetd -stayalive -pidfile /var/run/xinetd.pid

[root@lxbandt2 log]# service nrpe restart
Shutting down nrpe                                         [FAILED]
Starting nrpe                                              [  OK  ]

[root@lxbandt2 log]# ps -ef | grep nrpe | grep -v grep
/code]

I seem like there is no nrpe process and that when I run the service it might have failed as shown. It seem that the alerts are going to the nagios mailbox on the server instead and we are not getting it on the monitor main server.

I ran the /etc/init.d/nrpe as interactive and this is what I got:
[code]

[root@lxbandt2 init.d]# sh -x nrpe restart
+ NRPE_BIN=/usr/sbin/nrpe
+ NRPE_CFG=/etc/nagios/nrpe.cfg
+ LOCK_DIR=/var/lock/subsys
+ LOCK_FILE=/var/lock/subsys/nrpe
+ PID_FILE=/var/run/nrpe/nrpe.pid
+ test -x /usr/sbin/nrpe
+ RETVAL=0
+ MSG_CMD='echo -n'
+ START_CMD='daemon --pidfile /var/run/nrpe/nrpe.pid'
+ TERM_CMD='killproc -p /var/run/nrpe/nrpe.pid /usr/sbin/nrpe -TERM'
+ HUP_CMD='killproc -p /var/run/nrpe/nrpe.pid /usr/sbin/nrpe -HUP'
+ PRT_STAT=echo
+ STAT_MSG='echo -n Checking for nrpe daemon... '
+ STAT_CMD='status nrpe'
+ EXIT_CMD=exit
+ '[' -f /etc/rc.status ']'
+ '[' -f /etc/rc.d/init.d/functions ']'
+ . /etc/rc.d/init.d/functions
++ TEXTDOMAIN=initscripts
++ umask 022
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin
++ export PATH
++ '[' -z '' ']'
++ COLUMNS=80
++ '[' -z '' ']'
+++ /sbin/consoletype
++ CONSOLETYPE=pty
++ '[' -f /etc/sysconfig/i18n -a -z '' -a -z '' ']'
++ . /etc/profile.d/lang.sh
++ unset LANGSH_SOURCED
++ '[' -z '' ']'
++ '[' -f /etc/sysconfig/init ']'
++ . /etc/sysconfig/init
+++ BOOTUP=color
+++ RES_COL=60
+++ MOVE_TO_COL='echo -en \033[60G'
+++ SETCOLOR_SUCCESS='echo -en \033[0;32m'
+++ SETCOLOR_FAILURE='echo -en \033[0;31m'
+++ SETCOLOR_WARNING='echo -en \033[0;33m'
+++ SETCOLOR_NORMAL='echo -en \033[0;39m'
+++ PROMPT=yes
+++ AUTOSWAP=no
+++ ACTIVE_CONSOLES='/dev/tty[1-6]'
+++ SINGLE=/sbin/sushell
++ '[' pty = serial ']'
++ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
+++ cat /proc/cmdline
++ strstr 'ro root=/dev/mapper/ol-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=ol/root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=256M rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=ol/swap rhgb quiet numa=off transparent_hugepage=never' rc.debug
++ '[' 'ro root=/dev/mapper/ol-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=ol/root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=256M rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=ol/swap rhgb quiet numa=off transparent_hugepage=never' = 'ro root=/dev/mapper/ol-root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=ol/root rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=256M rd_NO_DM  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=ol/swap rhgb quiet numa=off transparent_hugepage=never' ']'
++ return 1
+ '[' -e /etc/sysconfig/nrpe ']'
+ . /etc/sysconfig/nrpe
++ NRPE_SSL_OPT=
+ case "$1" in
+ nrpe stop

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 3.1.1
Last Modified: 2017-05-24
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available, OpenSSL 0.9.6 or higher required
TCP Wrappers Available

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
**      Read the NRPE SECURITY file for more information     **
***************************************************************

Usage: nrpe [-n] -c <config_file> [-4|-6] <mode>

Options:
 -n               = Do not use SSL
 -c <config_file> = Name of config file to use
 -4               = use ipv4 only
 -6               = use ipv6 only
 <mode>           = One of the following operating modes:
   -i             =    Run as a service under inetd or xinetd
   -d             =    Run as a standalone daemon
   -d -s          =    Run as a subsystem under AIX
   -f             =    Don't fork() for systemd, launchd, etc.

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios.  It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.

+ nrpe start

NRPE - Nagios Remote Plugin Executor
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 3.1.1
Last Modified: 2017-05-24
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available, OpenSSL 0.9.6 or higher required
TCP Wrappers Available

***************************************************************
** POSSIBLE SECURITY RISK - COMMAND ARGUMENTS ARE SUPPORTED! **
**      Read the NRPE SECURITY file for more information     **
***************************************************************

Usage: nrpe [-n] -c <config_file> [-4|-6] <mode>

Options:
 -n               = Do not use SSL
 -c <config_file> = Name of config file to use
 -4               = use ipv4 only
 -6               = use ipv6 only
 <mode>           = One of the following operating modes:
   -i             =    Run as a service under inetd or xinetd
   -d             =    Run as a standalone daemon
   -d -s          =    Run as a subsystem under AIX
   -f             =    Don't fork() for systemd, launchd, etc.

Notes:
This program is designed to process requests from the check_nrpe
plugin on the host(s) running Nagios.  It can run as a service
under inetd or xinetd (read the docs for info on this), or as a
standalone daemon. Once a request is received from an authorized
host, NRPE will execute the command/plugin (as defined in the
config file) and return the plugin output and return code to the
check_nrpe plugin.

+ RETVAL=3
+ exit 3

I am not sure but it seem like the option for nrpe may not be right?

Please advise

Thanks in advance
Stephen LuShing
Locked