0

We've recently set up Nagios on one of our Amazon EC2 instances to act as a monitoring server to our other instances. nrpe was installed on our staging server stager and appears to be working fine:

monitoring_server~: /usr/lib/nagios/plugins/check_nrpe -H xx.xx.xx.xx -p 5666
NRPE v2.12

The issue is - when viewing the remote server stager within the Nagios admin screen - it appears to be 'DOWN'.

The check_ping command reveals:

monitoring_server~: /usr/lib/nagios/plugins/check_ping -H 'xx.xx.xx.xx' -w 5000,100% -c 5000,100% -p 1
PING CRITICAL - Packet loss = 100%|rta=5000.000000ms;5000.000000;5000.000000;0.000000 pl=100%;100;100;0

Can anyone provide some direction on how to get this working? Not sure what else to do

williamsowen
  • 1,167
  • 3
  • 16
  • 25
  • 4
    Can you ping the staging server from the monitoring server via an actual command line ping? Talking to NRPE is very different from getting an ICMP reply... – John Jun 25 '13 at 17:17
  • Cheers John - this was correct. ICMP reply was set up, and I can ping.. `ping -c 10 monitoring_server` - now works. – williamsowen Jul 23 '13 at 09:59

2 Answers2

2

Since you're unable to ping the EC2 instances, you're going to have to use a different plugin for the host checks.

And since you're going to use NRPE, you can use check_tcp pointed at port 5556 as a host check, for example.

Keith
  • 4,637
  • 15
  • 25
0

I understand this is an old post but with the comment before me Google's search brought the issue quite high in the list. Just had the same issue after a yum update so hopefully it will come useful to someone.

The fix for me for the time being was to downgrade iputils which I just had updated.

$ yum update iputils
Output
Updated: iputils-20180629-10.amzn2.aarch64
$ yum downgrade iputils
Output:
Installed: iputils-20160308-10.amzn2.0.2.aarch64

Why it is working when you run:

$ /usr/lib/nagios/plugins/check_ping -H 'xx.xx.xx.xx' -w 5000,100% -c 5000,100% -p 1

but not in Nagios is because check_ping runs with the user nagios.

You can replicate the issue in the command line using this following command:

$ sudo -u nagios /usr/lib64/nagios/plugins/check_ping -H 127.0.0.1 -w 5000,100% -c 5000,100% -p 1
Output:
/usr/bin/ping -n -U -W 10 -c 1 127.0.0.1
CRITICAL - Could not interpret output from ping command

Solution:

Running this command:

$ sysctl -w net.ipv4.ping_group_range="0 1000"

Allows the Nagios group enough permission to run ping even on the updated iputils package.

Olivier
  • 1
  • 1