5

I installed nrpe on new servers. Nagios is already running and checking other server (I haven't installed).

I've got several error lines in my syslog file :

Oct 31 15:17:01 myservername nrpe[41848]: Host nagios_ip is not allowed to talk to us!

My nrpe.cfg file includes the following line :

allowed_hosts=nagios_ip

What am I doing wrong ?

(with nagios_ip the actual IP for my nagios server)

6 Answers6

6

Had the same entry in my syslog. Editing /etc/nagios/nrpe.cfg and enter missing IP will fixed it at all.

allowed_hosts=1.2.3.4/24,127.0.0.1

After editing you have to restart or even reload nrpe deamon.

/etc/init.d/nagios-nrpe-server reload

Check if it is all fine with your configuration. Syslog should have an entry like this:

Allowing connections from: 1.2.3.4/24,127.0.0.1

I advise you not to add user nagios to sudoers because of security issues.

JaMaBing
  • 176
3

A lot of how-to's here and there ask you to allow your monitoring server IP like this in your host's /etc/nagios/nrpe.cfg :

allowed_hosts=127.0.0.1, 1.2.3.4

On some distribs (Ubuntu 14.04 LTS for instance), it's working. On other (Ubuntu 12.04 LTS - tested on Microsoft Azure in my case), it does not.

Just remove the space before second IP :

allowed_hosts=127.0.0.1,1.2.3.4

Then, of course, restart your host's nrpe service :

$ service nagios-nrpe-server restart
2

I found the solution, but the error message is totally misleading. The user nagios has to be in the suders...

/etc/sudoers:

nagios  ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/
0

I am having the same issue. However, this was previously working fine. there is no whitespace in my allowed_hosts line. However when I run systemctl status nrpe it shows that it is only allowing connections from 127.0.0.1.,::1 Issue only started recently

0

You do not want to add nagios to your sudoers file. If you're nagios server is in allowed_hosts but you're still getting this error, the following work flow will probably fix it (at least it did with mine):

sudo@host: ls -l /usr/lib/nagios/plugins/ if any are -rwxr-x-r-x then

sudo@host: chmod 777 /usr/lib/nagios/plugins/* sudo@host: /etc/init.d/nagios-nrpe-server reload

then to check, do on your nagios server

/usr/lib/nagios/plugins/check_nrpe -H <server>

Good Luck!

A.C
  • 9
0

I just ran into this problem myself. The way I fixed it was to remove all of the whitespace from the allowed_hosts line. This is on nrpe 2.12 that's shipping on ubuntu 12.04. There is some documentation that indicated you should use ', ' for the field delimiter, however that does not appear to be the case.