NRPE on Amazon Linux

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.
cybergene
Posts: 92
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE on Amazon Linux

Post 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.
Attachments
nrpe.conf
(497 Bytes) Downloaded 366 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Post 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?
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 on Amazon Linux

Post 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 ~]#
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Post 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?
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 on Amazon Linux

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Post 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?
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 on Amazon Linux

Post by cybergene »

This is what I get:

Code: Select all

root     21423 21185  0 15:25 pts/0    00:00:00 grep nrpe
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Post 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.
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 on Amazon Linux

Post 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.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked