Facing issue with NRPE no nagios core

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Facing issue with NRPE no nagios core

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Facing issue with NRPE no nagios core

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Facing issue with NRPE no nagios core

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Re: Facing issue with NRPE no nagios core

Post 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.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Facing issue with NRPE no nagios core

Post 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
        }

ericssonvietnam
Posts: 239
Joined: Mon Jun 27, 2016 11:05 pm

Re: Facing issue with NRPE no nagios core

Post 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.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Facing issue with NRPE no nagios core

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked