NRPE on Amazon Linux

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: NRPE on Amazon Linux

Postby cybergene » Fri Mar 17, 2017 8:12 am

I tried both V3 and V2.15 on the remote host. But it works now with V2.15.

On Nagios Core
Code: Select all
/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



I have looked into this more and it seems to be an issue with AWS Linux AMI. This instance has an old Linux and kernel, which is not compatible with NRPE version 3.x. The installation failed and nrpe config files weren't working. It didn't recognize nrpe as a and installed service on the system.

So, I installed NRPE v2.15 and I forced version 2 packet only. Now it works and doesn't generate any errors.

I'm not sure if there is any other workaround or fix for the NRPE version 3.x on Amazon Linux but this seems to work for now...
cybergene
 
Posts: 42
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE on Amazon Linux

Postby tgriep » Fri Mar 17, 2017 11:30 am

When you compiled the version 3 of the NRPE Agent on the remote host, did you receive any errors?
How old is that system, what OS and release is it running?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Postby cybergene » Fri Mar 17, 2017 12:37 pm

tgriep wrote:When you compiled the version 3 of the NRPE Agent on the remote host, did you receive any errors?
How old is that system, what OS and release is it running?


No, I didn't get any errors. I wasn't able to start nrpe at all.

This is what I found:

Code: Select all
1)NRPE [b]wasn't [/b]listening on TCP port 5666
2)NRPE [b]wasn't [/b]able to run or start
3)If you run: sudo service -status-all  ---> NRPE is not registered as a service
4)If you run service nrpe start, you get---> nrpe: unrecognized service
5)nrpe.conf exists under /etc/init/nrpe.conf, but unable to start nrpe


Result:

Code: Select all
1)Amazon LInux uses an old version of upstart that, for some reason, doesn’t like the nrpe.conf file
2)The log files complain about:
   -[i]/etc/init.conf: unable to load configuration: No such file or directory[/i]
   -[i]/etc/init/nrpe.conf:10 Illegal oom adjustment, expected -16 to 15 or never[/i]




Here ar the specs of the Amazon Linux AMI https://aws.amazon.com/amazon-linux-ami/2015.03-release-notes/

Thanks!
cybergene
 
Posts: 42
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE on Amazon Linux

Postby tgriep » Fri Mar 17, 2017 1:56 pm

Can that system run applications using xinetd?

If so, you can use this config to start nrpe using that.

Code: Select all
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream   
        port            = 5666   
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/local/nagios/bin/nrpe
        server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no
#       only_from       = 127.0.0.1
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Postby cybergene » Mon Mar 20, 2017 2:39 pm

I have a new environment coming up with AWS Linux. I will test it when we have it ready and will update if this works with xinetd.
cybergene
 
Posts: 42
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE on Amazon Linux

Postby tgriep » Mon Mar 20, 2017 4:38 pm

OK, keep us posted.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Postby cybergene » Thu Mar 30, 2017 12:41 pm

I wasn't able to install NRPE 3.0.1 with Xinetd on Amazon Linux

Code: Select all
Type sudo make install-daemon-config
make: *** No rule to make target `install-daemon-config'.  Stop.
sudo make install-xinetd
make: *** No rule to make target `install-xinetd'.  Stop.


I tried running all of this
Code: Select all
sudo make

Please enter make [option] where [option] is one of:

     all                  builds nrpe and check_nrpe
     nrpe                 builds nrpe only
     check_nrpe           builds check_nrpe only
     install-groups-users add the users and groups if they do not exist
     install              install nrpe and check_nrpe
     install-plugin       install the check_nrpe plugin
     install-daemon       install the nrpe daemon
     install-config       install the nrpe configuration file
     install-inetd        install the startup files for inetd, launchd, etc.
     install-init         install the startup files for init, systemd, etc.


step by step and still the service is not registered. I manually added the service to /etc/services and when I run

Code: Select all
[ec2-user@ip-xx-xx-xx-xx ~]$  netstat -a | grep -i listen
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 ip-xx-xx-xx-xx.us-east-:icp *:*                         LISTEN
tcp        0      0 ip-xx-xx-xx-x:ltp-deepspace *:*                         LISTEN
tcp        0      0 localhost:smtp              *:*                         LISTEN
tcp        0      0 *:idonix-metanet            *:*                         LISTEN
tcp        0      0 *:hsl-storm                 *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
unix  2      [ ACC ]     STREAM     LISTENING     9217   /var/run/dbus/system_bus_socket
unix  2      [ ACC ]     STREAM     LISTENING     7380   @/com/ubuntu/upstart
unix  2      [ ACC ]     SEQPACKET  LISTENING     7592   @/org/kernel/udev/udevd


I don't see the nrpe service running.

Amazon Linux is
Code: Select all
sudo cat /etc/*lease
NAME="Amazon Linux AMI"
VERSION="2015.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2015.03"
PRETTY_NAME="Amazon Linux AMI 2015.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2015.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
Amazon Linux AMI release 2015.03


Is there any limitation with nrpe V3 on this Linux? Should I just go with the old backage for Amazon Linux provided here: https://gist.github.com/cbschuld/7476829 ?
cybergene
 
Posts: 42
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE on Amazon Linux

Postby tgriep » Thu Mar 30, 2017 2:16 pm

When you ran the make install-init , it should of put an NRPE init file in the following folder
Code: Select all
/etc/init

If it is in there, you would have to start the service by running
Code: Select all
sudo service nrpe start

You may have to enable the NRPE daemon first by running
Code: Select all
sudo chkconfig nrpe on


Instead of it running under xinetd, it will run as a daemon.
Let us know what you find.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE on Amazon Linux

Postby cybergene » Fri Mar 31, 2017 6:58 am

tgriep wrote:When you ran the make install-init , it should of put an NRPE init file in the following folder
Code: Select all
/etc/init

The file is there nrpe.conf

If it is in there, you would have to start the service by running
Code: Select all
sudo service nrpe start


Result :
Code: Select all
[ec2-user@ip-xx-xx-xx-xx init]$ sudo service nrpe start
nrpe: unrecognized service



You may have to enable the NRPE daemon first by running
Code: Select all
sudo chkconfig nrpe on


This results in an Error and the nrpe is unrecognized:
Code: Select all
[ec2-user@ip-xx-xx-xx-xx init]$ sudo chkconfig nrpe on
error reading information on service nrpe: No such file or directory
[ec2-user@ip-xx-xx-xx-xx init]$ sudo service nrpe start
nrpe: unrecognized service


Instead of it running under xinetd, it will run as a daemon.
Let us know what you find.
cybergene
 
Posts: 42
Joined: Wed Aug 10, 2016 7:38 am
Location: Ottawa, Ontario, Canada

Re: NRPE on Amazon Linux

Postby tgriep » Fri Mar 31, 2017 8:50 am

Can you post the nrpe.cfg file from the /etc/init folder?
I have a feeling it is the wrong file.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 4930
Joined: Thu Oct 30, 2014 9:02 am

PreviousNext

Return to Nagios Core

Who is online

Users browsing this forum: Yahoo [Bot] and 14 guests