Page 1 of 1
Facing issue with NRPE no nagios core
Posted: Mon Nov 20, 2017 10:10 am
by ericssonvietnam
Getting issue with NRPE agent on linux server
I already have NRPE installed on client server but i am getting below error on all nodes.
CHECK_NRPE: Error - Could not connect to 150.236.11.215: Connection reset by peer
Re: Facing issue with NRPE no nagios core
Posted: Mon Nov 20, 2017 12:10 pm
by lmiltchev
What is the version of NRPE that you installed on the client?
The KB article below is written for XI but it's the same for Core:
https://support.nagios.com/kb/article/n ... e-615.html
Follow the troubleshooting steps, outlined in the article in order to fix your issue. Let us know if this helped. Thank you!
Re: Facing issue with NRPE no nagios core
Posted: Mon Nov 20, 2017 12:19 pm
by npolovenko
@ericssonvietnam, You need to add your Nagios Core server IP to the allowed hosts on the Linux agent. Depending on what Version of NRPE you have installed you need to either:
Code: Select all
/etc/xinetd.d/
only_from = 127.0.0.1 Nagios_Server_IP
or in
Code: Select all
/usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,Nagios_Server_IP
Notice how in the first case the IP address are separated by space but in the second case, they're separated by a comma.
Don't forget to restart NRPE after you made changes.
Re: Facing issue with NRPE no nagios core
Posted: Thu Nov 23, 2017 9:10 am
by ericssonvietnam
npolovenko wrote:@ericssonvietnam, You need to add your Nagios Core server IP to the allowed hosts on the Linux agent. Depending on what Version of NRPE you have installed you need to either:
Code: Select all
/etc/xinetd.d/
only_from = 127.0.0.1 Nagios_Server_IP
or in
Code: Select all
/usr/local/nagios/etc/nrpe.cfg
allowed_hosts=127.0.0.1,Nagios_Server_IP
Notice how in the first case the IP address are separated by space but in the second case, they're separated by a comma.
Don't forget to restart NRPE after you made changes.
Now i am able to get the data from the node but still getting some issue with disk check after defining command as well.
[root@localhost etc]# /usr/local/nagios/libexec/check_disk -x 150.236.11.217 -w 20 -c 10 -p /dev/sda2
DISK OK - free space: / 70912 MB (77.53% inode=98%);| /=20551MB;96339;96349;0;96359
can you suggest how i can define service of the above command.
Re: Facing issue with NRPE no nagios core
Posted: Mon Nov 27, 2017 12:11 pm
by npolovenko
@ericssonvietnam, Sure, in commands.cfg file you'd define:
Code: Select all
define command{
command_name check_custom_path
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARGS3$
}
And the service definition would look like this:
Code: Select all
define service{
use local-service
host_name localhost
service_description Check Custom Path
check_command check_custom_path!20!10!/dev/sda2
}
Re: Facing issue with NRPE no nagios core
Posted: Tue Nov 28, 2017 8:20 am
by ericssonvietnam
npolovenko wrote:@ericssonvietnam, Sure, in commands.cfg file you'd define:
Code: Select all
define command{
command_name check_custom_path
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARGS3$
}
And the service definition would look like this:
Code: Select all
define service{
use local-service
host_name localhost
service_description Check Custom Path
check_command check_custom_path!20!10!/dev/sda2
}
thanks its working now for me i installed latest nrpe on both client and server.
Re: Facing issue with NRPE no nagios core
Posted: Tue Nov 28, 2017 10:34 am
by npolovenko
@ericssonvietnam, Not a problem. I will close this thread as resolved but if you encounter other problems feel free to open a new one.