Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NRPE remote host setup on amazon ec2

I have been trying to monitor a remote server using Nagios-Nrpe. The remote host is the Amazon Ec2 instance where I have installed npre daemon on xinetd.

  • I have added my nagios server IP to "only-from" property in /etc/xinet.d/nrpe file.
  • I have added the entry in /etc/services.
  • I have made changes in iptables also.
  • I have added an entry for TCP port 5666 in my security group too.

These commands work properly:

$ netstat -at | grep nrpe 
$usr/local/nagios/libexec/check_nrpe -H localhost

I have setup the nagios server and nrpe_check plugin on my local machine. But whenever I am doing:

/usr/local/nagios/libexec/check_nrpe -H <"amazon-ec2-IP-address">

I get the following error:

connect to address <"amazon-ec2-IP-address"> port 5666: Connection refused ......
connect to host <"amazon-ec2-IP-address"> port 5666: Connection refused

I have tried making the nrpe client on another linux on my LAN and the command worked, but not for Amazon Ec2.

If anyone has the solution for this issue, please do share ASAP.

like image 710
Dushyant Gupta Avatar asked Nov 10 '22 16:11

Dushyant Gupta


1 Answers

Make sure you have,

Opened up port 5666 in the Security Group linked to the EC2-instance.

like image 138
pulsarjune Avatar answered Nov 14 '22 22:11

pulsarjune