Page 1 of 2

Problem with ICMP plugin

Posted: Sun Feb 22, 2015 2:02 am
by reincarne
Hi everyone,
I assume that the ICMP plugin is a built in plugin and I might get help here.
My problem is that I'm using to check a connection from once server to another via specific port, but when the VPN is down and the connection is lost, the plugin throws an error "Service check timeout" or "Socket timeout" (don't remember exactly) instead of something logical. I cannot edit this plugin as its a binary plugin.

Did someone face such problem?

Re: Problem with ICMP plugin

Posted: Sun Feb 22, 2015 12:25 pm
by questrad
Can you please be more clear.
As I understand, you using check_icmp plugin to check connection from server (same network where is Nagios) where check_icmp is executed to another server (located on your endpoint VPN side) and when VPN is goes down you get error, such "Service check timeout" or "Socket timeout"?
Or the server where you executing check_icmp is located some where else and your nagios server has connectivity to that server via your VPN connection?

Looking on your error messages, looks like you server where you executing check_icmp is located outside of your Nagios server network, you connecting to that server via VPN - so the behavior of Nagios is correct, because it has lost NRPE (if you use NRPE) cannot connect to remote server to execute check_icmp.

If you want to check your VPN connection, I think you need to executed PING to the server where is located under that VPN, so the Nagios check_icmp will return correct information, such:

Code: Select all

[root@localhost scripts]# /usr/local/nagios/libexec/check_icmp -H example2.com
CRITICAL - example2.com: rta nan, lost 100%|rta=0.000ms;200.000;500.000;0; pl=100%;40;80;; rtmax=0.000ms;;;; rtmin=0.000ms;;;;

Re: Problem with ICMP plugin

Posted: Sun Feb 22, 2015 11:26 pm
by reincarne
You are correct about everything you mentioned, so nothing to correct from my side.

I didn't know that check_icmp can be used for simple ping - I was sure you must provide Port.
What will be the difference in this case? It will lose the connection tothe nrpe too.

Re: Problem with ICMP plugin

Posted: Mon Feb 23, 2015 7:36 am
by reincarne
Ohh, I completely posted the incorrect plugin name.
The plugin that I'm using is check_tcp
This check cannot ping without a port number as long as I know.

Re: Problem with ICMP plugin

Posted: Mon Feb 23, 2015 10:25 am
by jdalrymple
It's difficult to tell what you're actually trying to do. If you're trying to check a generic TCP service on a remote host wouldn't it be desirable to get the results you're getting when your VPN connection is unavailable? If you're seeking to make the check only active while the VPN connection is alive I suggest using a service dependancy combined with check_icmp.

http://nagios.sourceforge.net/docs/3_0/ ... ncies.html

If I didn't describe the exact results you are trying to achieve could you please clarify for us?

Re: Problem with ICMP plugin

Posted: Mon Feb 23, 2015 11:19 am
by questrad
reincarne wrote:You are correct about everything you mentioned, so nothing to correct from my side.

I didn't know that check_icmp can be used for simple ping - I was sure you must provide Port.
What will be the difference in this case? It will lose the connection tothe nrpe too.

Yes, if VPN is donw it will lost NRPE connectivity as well.

You network diagram is following:
Nagios <-> VPN <-> OtherServer (check_tcp) -> OtherServer1 ?

The question is what you want to check?

Re: Problem with ICMP plugin

Posted: Mon Feb 23, 2015 5:42 pm
by lmiltchev
reincarne, did jdalrymple and questrad answer your question?

Re: Problem with ICMP plugin

Posted: Mon Mar 02, 2015 5:47 am
by reincarne
questrad wrote:
reincarne wrote:You are correct about everything you mentioned, so nothing to correct from my side.

I didn't know that check_icmp can be used for simple ping - I was sure you must provide Port.
What will be the difference in this case? It will lose the connection tothe nrpe too.

Yes, if VPN is donw it will lost NRPE connectivity as well.

You network diagram is following:
Nagios <-> VPN <-> OtherServer (check_tcp) -> OtherServer1 ?

The question is what you want to check?
Well, I want to check if the VPN tunnel is up by simply checking the connection from host 1 in region 1 to host 2 in region 2.
I assume the best way would be a simple ping check here, from host 1 to host 2, but I didn't find such plugin.

Re: Problem with ICMP plugin

Posted: Mon Mar 02, 2015 8:14 am
by questrad
Where is the Nagios located?
In region 1 or 2 or outside?

Please describe your network.
You can use check_icmp plugin as well, but at first you need to understood how Nagios is working.
If you executing icmp plugin using NCPA or NRPE agents on host 1 in region 1 to check host 2 in region 2 and Nagios server is outside and connected to host 1 via VPN - if VPN is down you will get timeout.

Re: Problem with ICMP plugin

Posted: Mon Mar 02, 2015 10:21 am
by jdalrymple
I'm still a bit confused reincarne - as questrad indicated check_icmp should do what you would expect:

Code: Select all

[jdalrymple@localhost libexec]$ ./check_icmp -H 192.168.254.1
CRITICAL - 192.168.254.1: rta nan, lost 100%|rta=0.000ms;200.000;500.000;0; pl=100%;40;80;; rtmax=0.000ms;;;; rtmin=0.000ms;;;;
Can you post the output of something similar to a network you know you cannot reach (purposefully make it fail) so we can make sure that your check results are consistent with ours? It sounds like that may be the problem.