Page 1 of 1
Problem with the PING monitor by NRPE
Posted: Wed Jan 17, 2018 4:09 pm
by neo_infraestructura
Hello everyone,
We are having trouble monitoring some devices. The monitoring is done through NRPE, making the request to an Linux server (Centos), who performs the corresponding checks with the device to monitor and then it send the results to Nagios. At least the services go well, but the PING made to the device gives a negative result, being that manually the PING from de Linux server does respond. In the attachments are the examples.
We suspect that the PING is being made directly and not through the Linux server, but we don’t know how to check or review it.
Any help or tips would be much appreciated!
Re: Problem with the PING monitor by NRPE
Posted: Wed Jan 17, 2018 4:25 pm
by npolovenko
Hello,
@neo_infraestructura . Please navigate to /usr/local/nagios/libexec/ and run the following commands and show us the output:
Code: Select all
./check_icmp -H 172.30.1.145
./check_ping -H 172.30.1.145 -w1,1% -c1,1%
Also please go to the Core Configurations Manager, find the host 172.30.1.145, click on it and take a screenshot of the Host Management Page.
Re: Problem with the PING monitor by NRPE
Posted: Thu Jan 18, 2018 1:52 pm
by neo_infraestructura
Hi @npolovenko, here are the images you ask for:
Just to say, the connection can't be from Nagios directly, but it can be made from the Linux server, that's why we are trying to make the monitoring throw the Linux server by NRPE, and it works, but the PING is the problem.
Re: Problem with the PING monitor by NRPE
Posted: Thu Jan 18, 2018 2:48 pm
by npolovenko
@neo_infraestructura, The first screenshot I was expecting to be from the XI Core Configurations Manager menu because it shows the command with arguments. Are you using Nagios XI or Nagios Core? I'm trying to see how the service is defined on the Nagios server, as well as the command.
the connection can't be from Nagios directly, but it can be made from the Linux server
In this case, please also upload the command definition from the monitored server, you should find it in the /usr/local/nagios/nrpe.cfg file.
Thank you.
Re: Problem with the PING monitor by NRPE
Posted: Thu Jan 18, 2018 3:45 pm
by neo_infraestructura
Please if this aren't the images you need, give me an example where to take the screenshot
Re: Problem with the PING monitor by NRPE
Posted: Thu Jan 18, 2018 5:13 pm
by lmiltchev
The '$HOSTADDRESS$' macro, that you are using in your command on the Nagios XI server should resolve to the IP address of the host, where the NRPE is installed. What you need is the ip of the host that you are trying to ping from the NRPE server (as you can't do it from the XI box)...
Can you run the following command on the Nagios XI server and show the output?
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <ip of the nrpe server> -c check_alive_ping -a '<ip of the server you are trying to ping>'
If you really want to use a macro (instead of showing the actual IP in the command), you could set a user macro in the resource.cfg file instead. Read more about user macros here:
https://assets.nagios.com/downloads/nag ... Macros.pdf
Re: Problem with the PING monitor by NRPE
Posted: Fri Jan 19, 2018 8:55 am
by neo_infraestructura
Here is the command you asked for. As you can see, the result is correct and there is no problem making the PING manually from Nagios throw NRPE, but still can't figure out why Nagiosxi is failing in this request. I think Nagios is making the PING directly, so the command 'check_alive_ping' is being excecuted directly to the '$HOSTADDRESS$' and not going throw the NRPE, but can't see where I can change that.
My suspicion is because before the monitoring was directly from Nagios, but with some changes in the FireWalls the monitoring have to be by NRPE throw the Linux Server , so I don't know if somewhere in Nagios the PING configuration in Nagios never changed.
Re: Problem with the PING monitor by NRPE
Posted: Fri Jan 19, 2018 10:16 am
by lmiltchev
Can you post the host config file from the Nagios server, along with all relevant templates, used by this check?
Re: Problem with the PING monitor by NRPE
Posted: Fri Jan 19, 2018 11:12 am
by neo_infraestructura
The problem was fixed. I searched for the object.cache in /var/nagiosramdisk/objects.cache and I saw that all the devices has a field called "check_command" and it had other description that doesn't made the ping through NRPE. Changing that to 'check_host_alive_nrpe' and it works.
Thanks for all the help and sorry to bother!
Re: Problem with the PING monitor by NRPE
Posted: Fri Jan 19, 2018 11:28 am
by lmiltchev
I am glad your issue was resolved! Locking the topic.