Page 3 of 5

Re: NRPE on Amazon Linux

Posted: Fri Mar 31, 2017 12:34 pm
by cybergene
tgriep wrote:Can you post the nrpe.cfg file from the /etc/init folder?
I have a feeling it is the wrong file.
See attached.

Re: NRPE on Amazon Linux

Posted: Fri Mar 31, 2017 1:37 pm
by tgriep
This is what the init script is trying to run.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
Can you run that command as root in a shell and see if it starts up?

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 9:26 am
by cybergene
tgriep wrote:This is what the init script is trying to run.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
Can you run that command as root in a shell and see if it starts up?

Nothing changes. I still can't get nrpe to run. Unrecognized service:

Code: Select all

[root@ip-xx-xx-xx-xx ~]# service nrpe start
nrpe: unrecognized service
[root@ip-xx-xx-xx-xx ~]#

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 9:49 am
by tgriep
That error is caused by a missing service config file on your system but if the software compiled on your server, you should be able to start NRPE in daemon mode by running.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f
Did this run on your server?

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 10:04 am
by cybergene
It doesn't show anything :

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -f









Then I test nrpe:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
connect to address 127.0.0.1 port 5666: Connection refused
connect to host localhost port 5666: Connection refused

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 10:15 am
by tgriep
Run the ps command to see if it is running in on the server.

Code: Select all

ps -ef |grep nrpe
Did you configure the firewall to allow port 5666 inbound traffic?

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 10:33 am
by cybergene
This is what I get:

Code: Select all

root     21423 21185  0 15:25 pts/0    00:00:00 grep nrpe

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 11:48 am
by tgriep
The output of the PS command doesn't show the NRPE Agent running at all.
You would have to look at the log files to see why it didn't start up when you manually ran the command.
Take a look in the /var/log/messages log file to see why it didn't start up.
Or you can just install and run the older pre-compiled version of the Agent.

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 12:28 pm
by cybergene
I don't see anything in the logs.

Code: Select all

nrpe[21779]: Starting up daemon
Apr  3 nrpe[21779]: Server listening on 0.0.0.0 port 5666.
Apr  3 nrpe[21779]: Server listening on :: port 5666.
Apr  3 nrpe[21779]: Listening for connections on port 5666
Apr  3 nrpe[21779]: Allowing connections from: xx.xx.xxx.xx
but I still get the connection refused error.

I guess I have no other choice than installing the older version.

Re: NRPE on Amazon Linux

Posted: Mon Apr 03, 2017 12:34 pm
by tgriep
Try running it like this and see if it stays running on the system.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d