Add the IP address of the nagios server to nrpe.cfg, for my case my configuration file is located in /usr/local/nagios/etc/nrpe.cfg
, if your cfg file is located else where use this command to find find / -name nrpe.cfg
Search for the parameter allowed_hosts
:
# (i.e. 192.168.1.0/24) are also supported. Hostname wildcards are not currentl$ # supported. # # Note: The daemon only does rudimentary checking of the client's IP # address. I would highly recommend adding entries in your /etc/hosts.allow # file to allow only the specified host to connect to the port # you are running this daemon on. # # NOTE: This option is ignored if NRPE is running under either inetd or xinetd allowed_hosts=127.0.0.1 192.168.0.140
append the nagios server ip address.
allowed_hosts is a comma-separated list, so that line should read
allowed_hosts=127.0.0.1,192.168.0.140
and not
allowed_hosts=127.0.0.1 192.168.0.140
I tought i have lost the file XD find / -name nrpe.cfg this comand its the glory haha.
(i know but its long to explaing, just wanted to shared my relief and say thanks for sharing your knowledge)